Skip to content

Conversation

@nrbrt
Copy link

@nrbrt nrbrt commented Jan 25, 2026

Summary

This PR fixes the deprecation warning reported in #170:

"Detected that custom integration 'dirigera_platform' sets option flow config_entry explicitly, which is deprecated"

Changes

Changed OptionsFlowHandler to inherit from config_entries.OptionsFlowWithConfigEntry instead of config_entries.OptionsFlow with explicit self.config_entry = config_entry assignment.

The parent class OptionsFlowWithConfigEntry handles the config_entry setup automatically, which is the recommended pattern in modern Home Assistant versions.

Before

class OptionsFlowHandler(config_entries.OptionsFlow):
    def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
        self.config_entry = config_entry  # Deprecated!

After

class OptionsFlowHandler(config_entries.OptionsFlowWithConfigEntry):
    """Options flow handler - config_entry is provided by parent class."""

Fixes #170

🤖 Generated with Claude Code

nrbrt and others added 11 commits January 13, 2026 11:33
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>
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>
@nrbrt
Copy link
Author

nrbrt commented Jan 26, 2026

Closing in favor of PR #186 which combines all fixes

@nrbrt nrbrt closed this Jan 26, 2026
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.

custom integration 'dirigera_platform' sets option flow config_entry explicitly

1 participant