Skip to content

fix: publish window entities as binary_sensors instead of switches#435

Merged
nanomad merged 3 commits intoSAIC-iSmart-API:developfrom
nanomad:fix/252-windows-as-binary-sensors
Mar 14, 2026
Merged

fix: publish window entities as binary_sensors instead of switches#435
nanomad merged 3 commits intoSAIC-iSmart-API:developfrom
nanomad:fix/252-windows-as-binary-sensors

Conversation

@nanomad
Copy link
Contributor

@nanomad nanomad commented Mar 14, 2026

Summary

  • Changes window HA discovery from switch to binary_sensor with device_class=window, since remote window control is not implemented and toggling the switches caused errors
  • Unpublishes old switch discovery entries on startup for a clean migration path
  • Adds tests for the new discovery behavior

Closes #252

Test plan

  • All 159 existing tests pass
  • 4 new tests verify windows are binary_sensors, old switches are unpublished, and sunroof conditional logic works
  • Manual: verify HA removes old switch.window_* entities and creates binary_sensor.window_* entities after gateway restart

🤖 Generated with Claude Code

nanomad and others added 3 commits March 14, 2026 16:55
…AIC-iSmart-API#252)

Window entities were exposed as switches in HA discovery but had no
command handlers, causing errors when toggled. Change them to
binary_sensors with device_class=window. Old switch discovery entries
are unpublished on startup to provide a clean migration path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add missing device_class="window" to sunroof binary_sensor
- Make test assertions unconditional (no silent pass on regression)
- Add payload verification to sunroof supported test
- Verify sunroof switch is always unpublished

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nanomad nanomad merged commit f1b0ebf into SAIC-iSmart-API:develop Mar 14, 2026
3 checks passed
@nanomad nanomad deleted the fix/252-windows-as-binary-sensors branch March 14, 2026 16:02
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