Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions homeassistant/components/emulated_hue/hue_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,12 @@ def _build_entity_state_dict(entity: State) -> dict[str, Any]:

if entity.domain == climate.DOMAIN:
temperature = attributes.get(ATTR_TEMPERATURE, 0)
# Convert 0-100 to 0-254
data[STATE_BRIGHTNESS] = round(temperature * HUE_API_STATE_BRI_MAX / 100)
# Handle climate device that returns null when switched off
if temperature is None:
data[STATE_BRIGHTNESS] = 0
else:
# Convert 0-100 to 0-254
data[STATE_BRIGHTNESS] = round(temperature * HUE_API_STATE_BRI_MAX / 100)
Comment on lines +725 to +730
Comment on lines 723 to +730
elif entity.domain == humidifier.DOMAIN:
humidity = attributes.get(ATTR_HUMIDITY, 0)
# Convert 0-100 to 0-254
Expand Down
Loading