Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
177a8e7
chore: add project infrastructure
clintongormley Feb 21, 2026
f450527
refactor: extract cover base class and add input mode subclasses
clintongormley Feb 21, 2026
2fed436
feat: replace xknx TravelCalculator with local implementation
clintongormley Feb 21, 2026
397db62
feat: add tilt strategies package
clintongormley Feb 21, 2026
43a2b5f
feat: add integration setup and config flow
clintongormley Feb 21, 2026
b4619d6
feat: add calibration system
clintongormley Feb 21, 2026
ce3b221
feat: add WebSocket API for cover configuration
clintongormley Feb 21, 2026
f5b3e5e
feat: add services, strings, and translations
clintongormley Feb 21, 2026
8357657
feat: add Lovelace configuration card
clintongormley Feb 21, 2026
875731c
test: add comprehensive test suite (97% coverage)
clintongormley Feb 21, 2026
6ade073
docs: update README and CHANGELOG
clintongormley Feb 21, 2026
756413c
docs: add design documents and implementation plans
clintongormley Feb 21, 2026
bc369e9
fix: add None guard to SequentialTilt.snap_trackers_to_physical
clintongormley Feb 21, 2026
df91ec2
refactor: extract shared constants to const.py
clintongormley Feb 22, 2026
824fb05
refactor: extract entity resolution to helpers.py
clintongormley Feb 22, 2026
ea0dd04
refactor: extract calibration methods into CalibrationMixin
clintongormley Feb 22, 2026
79e1a2e
refactor: move tilt planning helpers to tilt_strategies/planning.py
clintongormley Feb 22, 2026
e3616b7
refactor: deduplicate tilt strategy planning block
clintongormley Feb 22, 2026
8be07d9
refactor: reorder methods and functions into logical groups
clintongormley Feb 22, 2026
3cef175
docs: replace 20 individual plans with consolidated branch summary
clintongormley Feb 22, 2026
cda0dea
WIP: changes from v2 worktree
clintongormley Feb 22, 2026
a24cee7
feat: background pulse completion and tilt button pulse/toggle support
clintongormley Feb 22, 2026
f53d3df
docs: rewrite README with clearer setup instructions and reorganized …
clintongormley Feb 22, 2026
421a2b9
fix: set _last_command in _async_handle_command for toggle mode calib…
clintongormley Feb 22, 2026
dcad357
feat: merge device_type/input_mode into control_mode and require stop…
clintongormley Feb 24, 2026
8cae5ec
fix: prevent zero travel/tilt times in WebSocket API schema
clintongormley Feb 24, 2026
06c081b
fix: dual_motor tilt commands, YAML migration, and consistency fixes
clintongormley Feb 24, 2026
defbfe5
chore: add TYPE_CHECKING annotations to CalibrationMixin
clintongormley Feb 24, 2026
71a016c
fix: embed card translations in JS to fix HACS strings.json validation
clintongormley Feb 24, 2026
64f7058
fix: cancel lingering pulse tasks in tests for CI cleanup check
clintongormley Feb 24, 2026
2b6000c
style: ruff format cover_calibration.py
clintongormley Feb 24, 2026
8439676
fix: calibration expected_remaining and tilt restore _last_command
clintongormley Feb 24, 2026
57e7a57
Fix calibration direction override for tilt attributes
clintongormley Feb 24, 2026
ef8a803
fix: safe_tilt_position=0 coerced to 100, pulse_time docs inconsistency
clintongormley Feb 24, 2026
53255c5
fix: set_known_position no longer sends physical commands
clintongormley Feb 24, 2026
9a1d0da
fix: move cover controls from header to position section
clintongormley Feb 24, 2026
55a80d1
docs: update changelog for unreleased changes
clintongormley Feb 24, 2026
ac6c7c5
fix: skip same-state and calibration-active external state changes
clintongormley Feb 24, 2026
5eb96a2
fix: position-based startup delay calibration with direction-aware re…
clintongormley Feb 24, 2026
59b042c
test: comprehensive test coverage improvement (95% → 99.95%)
clintongormley Feb 24, 2026
a4a7f5b
feat: clear position to Unknown on external/manual movement
clintongormley Feb 25, 2026
066c8cb
fix: allow saving pulse mode without stop switch configured
clintongormley Feb 25, 2026
62b2c46
fix: skip tilt restore when target position is outside allowed tilt zone
clintongormley Feb 25, 2026
de23fc9
fix: calibration UI buttons, external state tracking, and pylint cleanup
clintongormley Feb 25, 2026
05c9c11
docs: update calibration section to reference open/stop/close buttons
clintongormley Feb 25, 2026
c8b1f4b
docs: add debugging and issue reporting sections to README
clintongormley Feb 25, 2026
e6dbe1c
docs: add behavioral spec and integration test design
clintongormley Feb 25, 2026
42eac4a
docs: add implementation plan for integration tests and bug fixes
clintongormley Feb 25, 2026
cb9b20e
fix: remove stop switch support from switch and toggle modes
clintongormley Feb 25, 2026
c7a027f
fix: pulse mode reacts on rising edge (OFF→ON) not falling edge
clintongormley Feb 25, 2026
1aed1ee
fix: toggle mode external state reacts on OFF→ON only
clintongormley Feb 25, 2026
3b4c81d
fix: remove toggle mode same-direction override
clintongormley Feb 25, 2026
c4d83da
fix: endpoint resync sends command + runon when already at target
clintongormley Feb 25, 2026
337fad0
fix: tilt overhead calibration uses 1/5 steps instead of 1/10
clintongormley Feb 25, 2026
a7204a5
test: add integration test infrastructure with smoke test
clintongormley Feb 25, 2026
8d0f512
test: integration tests for movement lifecycle
clintongormley Feb 25, 2026
d82564f
test: integration tests for feedback, modes, and lifecycle
clintongormley Feb 25, 2026
ecf81a7
test: integration tests for sequential tilt lifecycle
clintongormley Feb 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install homeassistant
pip install pytest pytest-asyncio pytest-homeassistant-custom-component

- name: Run tests
run: pytest tests/ -v

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install ruff
run: pip install ruff

- name: Check formatting
run: ruff format --check .

- name: Check linting
run: ruff check .
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@

__pycache__/

*.iml
*.iml
.coverage
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
## Unreleased

### Features

- **UI-first configuration:** Config flow creates covers via UI; all settings managed through a Lovelace card and WebSocket API
- **Control mode:** Single `control_mode` setting replaces separate `device_type`/`input_mode` — choose from wrapped, switch, pulse, or toggle
- **External state monitoring:** Detects physical switch presses and keeps the position tracker in sync with actual motor state. Supports all control modes for both cover and tilt switches
- **Separate tilt motor (dual_motor) mode:** Support for covers with a dedicated tilt motor, with configurable safe tilt position and max tilt allowed position
- **Inline tilt mode:** Support for covers where the tilt mechanism is part of the main travel range (e.g. Venetian blinds), with configurable tilt range within the overall travel
- **Calibration system:** Measure timing parameters interactively — start calibration, let the motor run, stop when done. Supports all travel and tilt timing attributes with overhead compensation
- **Background pulse completion:** Pulse and toggle mode commands return immediately while the relay pulse completes in the background
- **Tilt switch monitoring:** Monitors tilt switch entities for external changes in all modes (pulse, switch, toggle)
- **Lovelace configuration card:** Full settings UI with entity pickers, timing fields, tilt strategy selection, and calibration controls
- **Toggle mode improvements:** Debounce for momentary switches, cross-direction external toggles treated as stop, HA UI direction changes still reverse

### Improvements

- Replaced external `xknx` TravelCalculator dependency with a local HA-convention copy (no external dependencies)
- Card translations embedded directly in JS with `_t()` helper and `hass.language` locale lookup (English, Portuguese, Polish)
- Refactored codebase: extracted calibration mixin, tilt strategies package, shared constants, entity resolution helpers
- Updated calibration hint descriptions for all tilt modes (inline, sequential, dual_motor)
- Frontend defaults safe_tilt_position=100 and max_tilt_allowed_position=0 for new dual_motor configs
- Cleaned up diagnostic logging in toggle mode
- Improved test coverage from 66% to 97% (528 tests)

### Bug Fixes

- Fixed calibration direction override for tilt attributes — server now derives direction from attribute name instead of card sending position-based guess
- Fixed calibration overhead calculation for tilt (3 steps vs 8 travel steps)
- Fixed toggle mode tilt restore clearing `_last_command` prematurely, breaking stop pulse
- Fixed dual_motor tilt commands using wrong service calls
- Fixed `safe_tilt_position=0` being coerced to default 100
- Fixed zero travel/tilt times accepted by WebSocket API schema
- Fixed `_last_command` not set during toggle mode calibration
- Fixed pulse mode stop switch not stopping the position tracker
- Fixed toggle mode external state handler only reacting to ON→OFF (now handles both transitions)
- Fixed switch mode tilt handler using pulse-mode behavior (now uses latching: ON=start, OFF=stop)
- Fixed tilt switch echo filtering (pending=2 for direction switches to handle ON+OFF transitions)
- Fixed wrapped cover handler not tracking direction changes (opening→closing)

## 3.0.0 (2025-12-10)

### Features
Expand Down
Loading
Loading