Remove last remnants from 'descriptor'

This commit is contained in:
Teemu Rytilahti
2024-02-14 19:14:35 +01:00
parent 5dc190837c
commit fc29d2456e
5 changed files with 13 additions and 15 deletions

View File

@@ -302,12 +302,12 @@ class IotDevice(Device):
self._set_sys_info(response["system"]["get_sysinfo"])
if not self._features:
await self._initialize_descriptors()
await self._initialize_features()
await self._modular_update(req)
self._set_sys_info(self._last_update["system"]["get_sysinfo"])
async def _initialize_descriptors(self):
async def _initialize_features(self):
self.add_feature(
Feature(
device=self, name="RSSI", attribute_getter="rssi", icon="mdi:signal"

View File

@@ -38,7 +38,7 @@ class IotModule(ABC):
self._module_features: Dict[str, Feature] = {}
def add_feature(self, feature: Feature):
"""Add module descriptor."""
"""Add module feature."""
feature_name = f"{self._module}_{feature.name}"
if feature_name in self._module_features:
raise SmartDeviceException("Duplicate name detected %s" % feature_name)