Skip to content

fan: fetch initial preset_mode from bridge on startup#138

Merged
michaelarnauts merged 1 commit into
michaelarnauts:masterfrom
jensihnow:fix/fan-preset-mode-null
Apr 22, 2026
Merged

fan: fetch initial preset_mode from bridge on startup#138
michaelarnauts merged 1 commit into
michaelarnauts:masterfrom
jensihnow:fix/fan-preset-mode-null

Conversation

@jensihnow
Copy link
Copy Markdown
Contributor

The fan entity and the ventilation mode select both register for SENSOR_OPERATING_MODE. The bridge only pushes the current value on first registration, so whichever entity registers second never receives the initial value and preset_mode stays null until the mode changes.

Fetching the mode explicitly in async_added_to_hass ensures preset_mode is populated immediately on startup, regardless of registration order. This also prevents the resulting WebSocket error where the tile card reflects the null state and HA rejects it as an invalid preset mode.

Will improve and eventually fix #106

The fan entity and the ventilation mode select both register for
SENSOR_OPERATING_MODE. The bridge only pushes the current value on
first registration, so whichever entity registers second never receives
the initial value and preset_mode stays null until the mode changes.

Fetching the mode explicitly in async_added_to_hass ensures preset_mode
is populated immediately on startup, regardless of registration order.
This also prevents the resulting WebSocket error where the tile card
reflects the null state and HA rejects it as an invalid preset mode.
@michaelarnauts michaelarnauts merged commit e0d8d73 into michaelarnauts:master Apr 22, 2026
1 check 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.

Empty preset_mode for attribute for fan.comfoairq

2 participants