diff --git a/kasa/device.py b/kasa/device.py index 3cc21381..3c38b544 100644 --- a/kasa/device.py +++ b/kasa/device.py @@ -302,7 +302,7 @@ class Device(ABC): """Return the list of supported features.""" return self._features - def add_feature(self, feature: Feature): + def _add_feature(self, feature: Feature): """Add a new feature to the device.""" desc_name = feature.name.lower().replace(" ", "_") if desc_name in self._features: diff --git a/kasa/iot/iotdevice.py b/kasa/iot/iotdevice.py index 3d7b3ac1..85d95653 100755 --- a/kasa/iot/iotdevice.py +++ b/kasa/iot/iotdevice.py @@ -308,18 +308,18 @@ class IotDevice(Device): self._set_sys_info(self._last_update["system"]["get_sysinfo"]) async def _initialize_features(self): - self.add_feature( + self._add_feature( Feature( device=self, name="RSSI", attribute_getter="rssi", icon="mdi:signal" ) ) - self.add_feature( + self._add_feature( Feature( device=self, name="Time", attribute_getter="time", show_in_hass=False ) ) if "on_time" in self._sys_info: - self.add_feature( + self._add_feature( Feature( device=self, name="On since", @@ -344,7 +344,7 @@ class IotDevice(Device): if module.is_supported: supported[module._module] = module for module_feat in module._module_features.values(): - self.add_feature(module_feat) + self._add_feature(module_feat) self._supported_modules = supported diff --git a/kasa/iot/iotplug.py b/kasa/iot/iotplug.py index 17b30a2a..5182b10c 100644 --- a/kasa/iot/iotplug.py +++ b/kasa/iot/iotplug.py @@ -57,7 +57,7 @@ class IotPlug(IotDevice): self.add_module("time", Time(self, "time")) self.add_module("cloud", Cloud(self, "cnCloud")) - self.add_feature( + self._add_feature( Feature( device=self, name="LED", diff --git a/kasa/smart/smartdevice.py b/kasa/smart/smartdevice.py index 9bb75350..c9358df6 100644 --- a/kasa/smart/smartdevice.py +++ b/kasa/smart/smartdevice.py @@ -133,7 +133,7 @@ class SmartDevice(Device): async def _initialize_features(self): """Initialize device features.""" - self.add_feature( + self._add_feature( Feature( self, "Signal Level", @@ -141,7 +141,7 @@ class SmartDevice(Device): icon="mdi:signal", ) ) - self.add_feature( + self._add_feature( Feature( self, "RSSI", @@ -149,17 +149,17 @@ class SmartDevice(Device): icon="mdi:signal", ) ) - self.add_feature( + self._add_feature( Feature( device=self, name="Time", attribute_getter="time", show_in_hass=False ) ) - self.add_feature( + self._add_feature( Feature(device=self, name="SSID", attribute_getter="ssid", icon="mdi:wifi") ) if "overheated" in self._info: - self.add_feature( + self._add_feature( Feature( self, "Overheated", @@ -172,7 +172,7 @@ class SmartDevice(Device): # We check for the key available, and not for the property truthiness, # as the value is falsy when the device is off. if "on_time" in self._info: - self.add_feature( + self._add_feature( Feature( device=self, name="On since",