Return attribute dict directly without temporary variable (#41206)

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

No files matched your search

@@ -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)