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

View File

@@ -189,10 +189,10 @@ some_led2:
# конфиг
```
#### i2c {: #i2c}
Для сенсоров i2c адресация конфига такая:
Для сенсоров i2c нужно так же указать id сенсора, который можно посмотреть в атрибутах объекта на [странице разработчика](https://my.home-assistant.io/redirect/developer_states/).
```yaml
36:
htu21d_humidity: # entity_id сенсора без приставки sensor., видно в интерфейсе HA
htu21d_humidity: # i2c_id
# конфиг
```
[Подробнее про i2c](i2c.md)