mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Implement feature categories (#846)
Initial implementation for feature categories to help downstreams and our cli tool to categorize the data for more user-friendly manner. As more and more information is being exposed through the generic features interface, it is necessary to give some hints to downstreams about how might want to present the information to users. This is not a 1:1 mapping to the homeassistant's mental model, and it will be necessary to fine-tune homeassistant-specific parameters by other means to polish the presentation.
This commit is contained in:
@@ -221,6 +221,7 @@ class IotBulb(IotDevice, Bulb):
|
||||
minimum_value=1,
|
||||
maximum_value=100,
|
||||
type=FeatureType.Number,
|
||||
category=Feature.Category.Primary,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -233,6 +234,7 @@ class IotBulb(IotDevice, Bulb):
|
||||
attribute_getter="color_temp",
|
||||
attribute_setter="set_color_temp",
|
||||
range_getter="valid_temperature_range",
|
||||
category=Feature.Category.Primary,
|
||||
)
|
||||
)
|
||||
|
||||
|
@@ -306,7 +306,11 @@ class IotDevice(Device):
|
||||
async def _initialize_features(self):
|
||||
self._add_feature(
|
||||
Feature(
|
||||
device=self, name="RSSI", attribute_getter="rssi", icon="mdi:signal"
|
||||
device=self,
|
||||
name="RSSI",
|
||||
attribute_getter="rssi",
|
||||
icon="mdi:signal",
|
||||
category=Feature.Category.Debug,
|
||||
)
|
||||
)
|
||||
if "on_time" in self._sys_info:
|
||||
|
Reference in New Issue
Block a user