-
Notifications
You must be signed in to change notification settings - Fork 35
Fix deprecation warning: use OptionsFlowWithConfigEntry #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IKEA MYGGSPRAY motion sensors (E2494) report as deviceType 'occupancySensor' instead of 'motionSensor'. They also lack the 'is_on' attribute that regular motion sensors have. This PR fixes both issues by: - Including 'occupancySensor' in motion sensor queries - Creating MotionSensorX with optional is_on attribute - Overriding get_motion_sensors() and get_motion_sensor_by_id() Tested with IKEA MYGGSPRAY E2494 sensors on Home Assistant 2026.1.1.
MYGGSPRAY motion sensors send events as occupancySensor device type. Without this, the hub_event_listener ignores real-time state changes from these sensors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Cherry-picked from sanjoyg#163 by noahwilliamsson
Cherry-picked from sanjoyg#174 by lordylike Fixes sanjoyg#171
Cherry-picked from sanjoyg#182 by stirante
Cherry-picked from sanjoyg#161 by JuhaMR
STYRBAR has 4 buttons but was treated as 1-button controller. This enables button1_*, button2_*, button3_*, button4_* triggers.
Adds English translations for button3_* and button4_* triggers to support 4-button controllers like STYRBAR.
STYRBAR, RODRET and similar lightController-type remotes send remotePressEvent messages via WebSocket instead of sceneUpdated. Previously these were discarded as "non state message". This commit adds a new handler (parse_remote_press_event) that: - Parses remotePressEvent messages from lightController devices - Converts clickPattern to trigger types (single_click, long_press, etc) - Handles multi-button controllers using the _N suffix - Debounces duplicate events within 1 second (IKEA bug workaround) - Fires dirigera_platform_event for Home Assistant automations Enables use of STYRBAR 4-button and RODRET 2-button remotes in Home Assistant automations without requiring scene configuration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The min_color_temp_kelvin, max_color_temp_kelvin, and color_temp_kelvin properties were returning raw mired values from Dirigera instead of converting them to Kelvin as Home Assistant expects. Also fixed async_turn_on to use direct API patch for setting color temperature, bypassing the dirigera library's broken validation that rejects valid Kelvin values. Fixes sanjoyg#181 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed OptionsFlowHandler to inherit from OptionsFlowWithConfigEntry instead of OptionsFlow with explicit self.config_entry assignment. This fixes the deprecation warning: "Detected that custom integration 'dirigera_platform' sets option flow config_entry explicitly, which is deprecated" Fixes sanjoyg#170 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Author
|
Closing in favor of PR #186 which combines all fixes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the deprecation warning reported in #170:
Changes
Changed
OptionsFlowHandlerto inherit fromconfig_entries.OptionsFlowWithConfigEntryinstead ofconfig_entries.OptionsFlowwith explicitself.config_entry = config_entryassignment.The parent class
OptionsFlowWithConfigEntryhandles the config_entry setup automatically, which is the recommended pattern in modern Home Assistant versions.Before
After
Fixes #170
🤖 Generated with Claude Code