Skip to content

Commit

Permalink
fix setting attribute changes state to None
Browse files Browse the repository at this point in the history
  • Loading branch information
regevbr authored and mdeweerd committed Mar 13, 2024
1 parent fddfe74 commit ced7097
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/zha_toolkit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,11 @@ def set_state(
# entity_id, key, value, stateAttrs)
if key is not None:
stateAttrs[key] = value
value = None
if stateObj is not None:
# Copy existing state, to update selected item
value = stateObj.state
else:
value = None

# LOGGER.debug("entity:%s key:%s value:%s attrs:%s",
# entity_id, key, value, stateAttrs)
Expand Down

0 comments on commit ced7097

Please sign in to comment.