Skip to content

Conversation

@lehneres
Copy link

Summary

This PR adds optional diagnostic status sensors per light, giving visibility into whether Adaptive Lighting is actively controlling a light, blocked, manually overridden, or idle. It also aggregates status across multiple profiles controlling the same light.

Key Changes

  • New sensor platform (sensor.py) with one diagnostic sensor per light.
  • Status tracking in switch.py with per-profile and combined state.
  • Constants and attributes in const.py.
  • Option enable_diagnostic_sensors (default false) to toggle sensors per profile.
  • Ensures new entities are enabled when diagnostics are turned on.
  • Docs: docs/status_sensors.md and README note.

Behavior

  • Sensor states: inactive, adopting, active, manual_override, blocked, error.
  • Combined state priority: error > manual_override > adopting > active > blocked > inactive.
  • status_profiles attribute exposes per-profile detail.
  • If light is off, combined state is inactive.
  • Sensors are created only when enable_diagnostic_sensors is true.

Testing

  • Manual validation in HA:
    • Toggle diagnostic sensors on/off in options.
    • Verify entities appear without restart.
    • Confirm state transitions during adaptation and manual override.
  • python3 -m py_compile on updated files.

Notes

  • No breaking changes; feature is opt-in.
  • Sensors are diagnostic category and grouped with their light device when possible.

lehneres and others added 5 commits January 23, 2026 20:13
- Implemented per-light status tracking to provide detailed states like "active," "inactive," "blocked," and "manual override."
- Added new `sensor` platform for enhanced diagnostics.
- Updated README to include diagnostic status sensors.
- Introduced various status-related attributes and methods for better monitoring and troubleshooting.
Added a new configuration option `enable_diagnostic_sensors` to control the creation of per-light status sensors in the Adaptive Lighting integration. Sensors are now disabled by default and can be enabled via the options flow. Updated related files, including initialization logic, constants, translations, and documentation.
@lehneres lehneres marked this pull request as ready for review January 24, 2026 09:09
@lehneres lehneres requested a review from basnijholt as a code owner January 24, 2026 09:09
@lehneres lehneres marked this pull request as draft January 25, 2026 13:53
@lehneres lehneres marked this pull request as ready for review January 26, 2026 14:14
@lehneres lehneres marked this pull request as draft January 28, 2026 09:51
@lehneres lehneres marked this pull request as ready for review January 29, 2026 04:49
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