mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-10 16:44:28 +05:00
fix focs about i2c id
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user