Improve categorization of features (#904)

This updates the categorization of features and makes the id mandatory for features
This commit is contained in:
Teemu R
2024-05-07 11:13:35 +02:00
committed by GitHub
parent 50b5107f75
commit 55653d0346
31 changed files with 131 additions and 52 deletions

View File

@@ -22,7 +22,8 @@ class TemperatureSensor(SmartModule):
self._add_feature(
Feature(
device,
"Temperature",
id="temperature",
name="Temperature",
container=self,
attribute_getter="temperature",
icon="mdi:thermometer",
@@ -33,17 +34,20 @@ class TemperatureSensor(SmartModule):
self._add_feature(
Feature(
device,
"Temperature warning",
id="temperature_warning",
name="Temperature warning",
container=self,
attribute_getter="temperature_warning",
type=Feature.Type.BinarySensor,
icon="mdi:alert",
category=Feature.Category.Debug,
)
)
self._add_feature(
Feature(
device,
"Temperature unit",
id="temperature_unit",
name="Temperature unit",
container=self,
attribute_getter="temperature_unit",
attribute_setter="set_temperature_unit",