Skip to content

Commit

Permalink
Remove xiaomi_aqara entity_description property (home-assistant#56456)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p authored Sep 20, 2021
1 parent df56953 commit 20ddd09
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions homeassistant/components/xiaomi_aqara/sensor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Support for Xiaomi Aqara sensors."""
from __future__ import annotations

from functools import cached_property
import logging

from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
Expand Down Expand Up @@ -154,13 +153,9 @@ class XiaomiSensor(XiaomiDevice, SensorEntity):
def __init__(self, device, name, data_key, xiaomi_hub, config_entry):
"""Initialize the XiaomiSensor."""
self._data_key = data_key
self.entity_description = SENSOR_TYPES[data_key]
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):
"""Parse data sent by gateway."""
value = data.get(self._data_key)
Expand Down

0 comments on commit 20ddd09

Please sign in to comment.