mirror of
https://github.com/sususweet/midea-meiju-codec.git
synced 2025-09-28 02:32:40 +00:00
v0.0.4
This commit is contained in:
@@ -16,16 +16,17 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
device_id = config_entry.data.get(CONF_DEVICE_ID)
|
||||
device = hass.data[DOMAIN][DEVICES][device_id].get(CONF_DEVICE)
|
||||
manufacturer = hass.data[DOMAIN][DEVICES][device_id].get("manufacturer")
|
||||
rationale = hass.data[DOMAIN][DEVICES][device_id].get("rationale")
|
||||
entities = hass.data[DOMAIN][DEVICES][device_id].get(CONF_ENTITIES).get(Platform.SENSOR)
|
||||
devs = []
|
||||
if entities is not None:
|
||||
for entity_key, config in entities.items():
|
||||
devs.append(MideaSensorEntity(device, manufacturer, entity_key, config))
|
||||
devs.append(MideaSensorEntity(device, manufacturer, rationale, entity_key, config))
|
||||
async_add_entities(devs)
|
||||
|
||||
|
||||
class MideaSensorEntity(MideaEntity, SensorEntity):
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
def native_value(self):
|
||||
return self._device.get_attribute(self._entity_key)
|
||||
|
Reference in New Issue
Block a user