Skip to content

Keep switches available when Disable Available Check is on - #523

Merged
RobHofmann merged 1 commit into
masterfrom
fix/switch-available-check
Sep 23, 2026
Merged

RobHofmann merged 1 commit into
masterfrom
fix/switch-available-check

Conversation

@RobHofmann

Copy link
Copy Markdown
Owner

Problem

Since #508 (released in 4.0.7), users with Disable Available Check turned on see seven switches as unavailable all the time: xfan, lights, health, powersave, 8 degC heat, sleep and air. The climate entity itself still works.

Cause

_prop_supported() in switch.py returns device._device_online. With the option on, climate.py never sets that field, so it stays None. The climate entity's own available checks the option first, so only the switches were affected. Before #508 these switches were always available.

Change

_prop_supported() now returns the climate entity's available. The switches then follow the same rule as the climate entity: always available with the option on, and online or offline otherwise. Hiding unsupported props (an empty value after the first sync) is unchanged.

Testing

On my fake-device harness, which drives the real climate.py and switch.py:

Since #508, the xfan, lights, health, powersave, 8 degC heat, sleep and air
switches took their availability from `_device_online`. With "Disable
Available Check" on, the climate entity never sets that field, so it stays
None and the seven switches were unavailable for good. The climate entity
itself stayed available, because its `available` checks the option first.

`_prop_supported()` now uses the climate entity's `available`, so the
switches follow the same rule as the climate entity.
@RobHofmann
RobHofmann merged commit 90a3c64 into master Sep 23, 2026
@RobHofmann
RobHofmann deleted the fix/switch-available-check branch September 23, 2026 20:51
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