1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-22 11:59:34 +00:00

Return attribute dict directly without temporary variable (#41206)

This commit is contained in:
springstan
2020-10-05 12:51:48 +02:00
committed by GitHub
parent cf5c99d2a9
commit 038c05d0ee
23 changed files with 27 additions and 60 deletions

View File

@@ -120,8 +120,7 @@ class AlarmDecoderBinarySensor(BinarySensorEntity):
@property
def device_state_attributes(self):
"""Return the state attributes."""
attr = {}
attr[CONF_ZONE_NUMBER] = self._zone_number
attr = {CONF_ZONE_NUMBER: self._zone_number}
if self._rfid and self._rfstate is not None:
attr[ATTR_RF_BIT0] = bool(self._rfstate & 0x01)
attr[ATTR_RF_LOW_BAT] = bool(self._rfstate & 0x02)