mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Remove xiaomi_aqara entity_description property (#56456)
This commit is contained in:
parent
df56953c98
commit
20ddd092f6
@ -1,7 +1,6 @@
|
|||||||
"""Support for Xiaomi Aqara sensors."""
|
"""Support for Xiaomi Aqara sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from functools import cached_property
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
|
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
|
||||||
@ -154,13 +153,9 @@ class XiaomiSensor(XiaomiDevice, SensorEntity):
|
|||||||
def __init__(self, device, name, data_key, xiaomi_hub, config_entry):
|
def __init__(self, device, name, data_key, xiaomi_hub, config_entry):
|
||||||
"""Initialize the XiaomiSensor."""
|
"""Initialize the XiaomiSensor."""
|
||||||
self._data_key = data_key
|
self._data_key = data_key
|
||||||
|
self.entity_description = SENSOR_TYPES[data_key]
|
||||||
super().__init__(device, name, xiaomi_hub, config_entry)
|
super().__init__(device, name, xiaomi_hub, config_entry)
|
||||||
|
|
||||||
@cached_property
|
|
||||||
def entity_description(self) -> SensorEntityDescription: # type: ignore[override]
|
|
||||||
"""Return entity_description for data_key."""
|
|
||||||
return SENSOR_TYPES[self._data_key]
|
|
||||||
|
|
||||||
def parse_data(self, data, raw_data):
|
def parse_data(self, data, raw_data):
|
||||||
"""Parse data sent by gateway."""
|
"""Parse data sent by gateway."""
|
||||||
value = data.get(self._data_key)
|
value = data.get(self._data_key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user