Skip to content

Commit ed46403

Browse files
committed
Add behave hook to pre-commit and CI
Pre-commit / CI: - Add local behave hook (language: python, all project deps listed) - Add behave step to GitHub Actions workflow Bug fixes in sound player state machine: - fade_in/callable.Forced: was calling compute_new_state(state, "base", ...) but "base" is not a registered output state for fade_in, causing a silent KeyError and leaving the state in fade_in instead of transitioning to forced_off. Fix: use get_new_state(state, "forced_off") for forced.Off. - sound_player.feature: rows @1.3 and @1.45 expected off after sleepiness.Awake from an off-with-elapsed-On setup, but the auto-inject (elapsed.Event.Off injected on fade_in→off) means the off state always has elapsed=Off after a fade-in cycle, so sleepiness.Awake correctly transitions to fade_in. Update expected state to fade_in. Fix scheduler trigger type check - Fix scheduler trigger type comparison: change `type` from @Property to a class variable in Trigger, state.Trigger, and protocol.Trigger so that class-level comparisons (e.g. Trigger.type == "APPLIANCE STATE") work correctly; this fixes 5 failing unit tests where _schedule_by_trigger_fork was never called Improve documentation: replace sphinx-gherkindoc, add docs target, fix English - Replace broken sphinx-gherkindoc (incompatible with Sphinx 9) with a lightweight custom script docs/gherkindoc.py that converts .feature files to RST code-block pages using only the Python standard library - Update docs/Makefile to use the new script via the PYTHON variable - Fix numerous English issues across all RST documentation files and README: Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7fd922e commit ed46403

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+6856
-5949
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Unit Tests
1+
name: Tests
22

33
on:
44
push:
@@ -28,6 +28,10 @@ jobs:
2828
run: |
2929
python -m coverage run -m unittest discover -s home/tests -t . -v
3030
31+
- name: Run behave tests with coverage
32+
run: |
33+
python -m coverage run --append -m behave home/features/
34+
3135
- name: Generate coverage report
3236
run: |
3337
python -m coverage report -m

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,21 @@ repos:
1818
args: [--config-file=pyproject.toml]
1919
additional_dependencies: [types-PyYAML, types-pytz, types-tzlocal]
2020
exclude: ^(home/tests/|docs/)
21+
22+
- repo: local
23+
hooks:
24+
- id: behave
25+
name: behave
26+
entry: behave
27+
args: [home/features/]
28+
language: python
29+
additional_dependencies:
30+
- behave
31+
- APScheduler>=3.10.0
32+
- redis>=4.2.0
33+
- hiredis>=2.0.0
34+
- ephem
35+
- tzlocal
36+
- pytz
37+
- PyYAML
38+
pass_filenames: false

0 commit comments

Comments
 (0)