Skip to content

fix: restore door sensor state across restarts (0.11.0) - #44

Merged
dougrathbone merged 2 commits into
mainfrom
fix/door-sensor-restore-state
Nov 8, 2026
Merged

dougrathbone merged 2 commits into
mainfrom
fix/door-sensor-restore-state

Conversation

@dougrathbone

Copy link
Copy Markdown
Owner

Summary

  • DoormanDoorSensor is now a RestoreEntity: the 2N only emits DoorStateChanged on transitions, so after every HA restart the door sensor sat at unknown until the door next moved. It now restores its last on/off state.
  • Restored unknown/unavailable is ignored, and live events still override the restored value.
  • Bumps version to 0.11.0 (manifest.json + PANEL_VERSION).

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • CI/build (version bump)

Testing

  • Unit tests added / updated (restore on/off, ignore unknown/unavailable, live event overrides restored state)
  • pytest tests/ --ignore=tests/integration passes locally (443 passed, Python 3.14, PHACC 0.13.371)
  • ruff check custom_components/ tests/ passes
  • Tested against a real 2N device (if applicable)

Checklist

  • Version bumped in manifest.json (if shipping a release)
  • strings.json / translations updated (if adding new UI strings) - n/a
  • No secrets, credentials, or device-specific config committed

The 2N only emits DoorStateChanged on transitions, so after every HA
restart binary_sensor.<slug>_door sat at unknown until the door next
moved. Make DoormanDoorSensor a RestoreEntity and seed is_on from the
last on/off state; restored unknown/unavailable is ignored, and live
events still override the restored value.
@dougrathbone
dougrathbone merged commit 2e08be9 into main Nov 8, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant