Skip to content

Commit ae74966

Browse files
authored
check for attr (#1305)
1 parent 0679b09 commit ae74966

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

zhaquirks/xiaomi/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,10 @@ def _update_attribute(self, attrid, value):
276276
0x0000, attributes[TVOC_MEASUREMENT]
277277
)
278278
if TEMPERATURE in attributes:
279-
self.endpoint.device_temperature.update_attribute(
280-
0x0000, attributes[TEMPERATURE] * 100
281-
)
279+
if hasattr(self.endpoint, "device_temperature"):
280+
self.endpoint.device_temperature.update_attribute(
281+
0x0000, attributes[TEMPERATURE] * 100
282+
)
282283
if BATTERY_PERCENTAGE_REMAINING_ATTRIBUTE in attributes:
283284
self.endpoint.device.power_bus_percentage.listener_event(
284285
"update_battery_percentage",

0 commit comments

Comments
 (0)