mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
I think this is a potential bug (#23157)
This commit is contained in:
parent
6a40a712cd
commit
7a9c9031af
@ -241,9 +241,9 @@ class Entity:
|
|||||||
"""Write the state to the state machine."""
|
"""Write the state to the state machine."""
|
||||||
start = timer()
|
start = timer()
|
||||||
|
|
||||||
|
attr = {}
|
||||||
if not self.available:
|
if not self.available:
|
||||||
state = STATE_UNAVAILABLE
|
state = STATE_UNAVAILABLE
|
||||||
attr = {}
|
|
||||||
else:
|
else:
|
||||||
state = self.state
|
state = self.state
|
||||||
|
|
||||||
@ -252,10 +252,8 @@ class Entity:
|
|||||||
else:
|
else:
|
||||||
state = str(state)
|
state = str(state)
|
||||||
|
|
||||||
attr = self.state_attributes or {}
|
attr.update(self.state_attributes or {})
|
||||||
device_attr = self.device_state_attributes
|
attr.update(self.device_state_attributes or {})
|
||||||
if device_attr is not None:
|
|
||||||
attr.update(device_attr)
|
|
||||||
|
|
||||||
unit_of_measurement = self.unit_of_measurement
|
unit_of_measurement = self.unit_of_measurement
|
||||||
if unit_of_measurement is not None:
|
if unit_of_measurement is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user