fix focs about i2c id

This commit is contained in:
Викторов Андрей Германович
2021-09-21 17:33:22 +03:00
parent 975b2e8a38
commit 8399bbd1de
2 changed files with 10 additions and 2 deletions

View File

@@ -165,6 +165,14 @@ class MegaI2C(FilterBadValues):
def customize(self):
return super().customize.get(self.id_suffix, {}) or {}
@property
def extra_state_attributes(self):
attrs = super().extra_state_attributes or {}
attrs.update({
'i2c_id': self.id_suffix,
})
return attrs
@property
def device_class(self):
return self._device_class