mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-06 10:44:04 +00:00
Require explicit feature type (#1006)
Explicit > implicit. Having this previously would have avoided using a wrong type for water_alert in the first place.
This commit is contained in:
@@ -43,6 +43,7 @@ class Alarm(SmartModule):
|
||||
container=self,
|
||||
attribute_getter="source",
|
||||
icon="mdi:bell",
|
||||
type=Feature.Type.Sensor,
|
||||
)
|
||||
)
|
||||
self._add_feature(
|
||||
|
@@ -56,6 +56,7 @@ class AutoOff(SmartModule):
|
||||
container=self,
|
||||
attribute_getter="auto_off_at",
|
||||
category=Feature.Category.Info,
|
||||
type=Feature.Type.Sensor,
|
||||
)
|
||||
)
|
||||
|
||||
|
@@ -101,6 +101,7 @@ class Firmware(SmartModule):
|
||||
container=self,
|
||||
attribute_getter="current_firmware",
|
||||
category=Feature.Category.Debug,
|
||||
type=Feature.Type.Sensor,
|
||||
)
|
||||
)
|
||||
self._add_feature(
|
||||
@@ -111,6 +112,7 @@ class Firmware(SmartModule):
|
||||
container=self,
|
||||
attribute_getter="latest_firmware",
|
||||
category=Feature.Category.Debug,
|
||||
type=Feature.Type.Sensor,
|
||||
)
|
||||
)
|
||||
|
||||
|
@@ -29,6 +29,7 @@ class HumiditySensor(SmartModule):
|
||||
icon="mdi:water-percent",
|
||||
unit="%",
|
||||
category=Feature.Category.Primary,
|
||||
type=Feature.Type.Sensor,
|
||||
)
|
||||
)
|
||||
self._add_feature(
|
||||
|
@@ -28,6 +28,7 @@ class ReportMode(SmartModule):
|
||||
attribute_getter="report_interval",
|
||||
unit="s",
|
||||
category=Feature.Category.Debug,
|
||||
type=Feature.Type.Sensor,
|
||||
)
|
||||
)
|
||||
|
||||
|
@@ -84,6 +84,7 @@ class TemperatureControl(SmartModule):
|
||||
container=self,
|
||||
attribute_getter="mode",
|
||||
category=Feature.Category.Primary,
|
||||
type=Feature.Type.Sensor,
|
||||
)
|
||||
)
|
||||
|
||||
|
@@ -29,6 +29,7 @@ class TemperatureSensor(SmartModule):
|
||||
icon="mdi:thermometer",
|
||||
category=Feature.Category.Primary,
|
||||
unit_getter="temperature_unit",
|
||||
type=Feature.Type.Sensor,
|
||||
)
|
||||
)
|
||||
if "current_temp_exception" in device.sys_info:
|
||||
|
@@ -30,6 +30,7 @@ class Time(SmartModule):
|
||||
attribute_getter="time",
|
||||
container=self,
|
||||
category=Feature.Category.Debug,
|
||||
type=Feature.Type.Sensor,
|
||||
)
|
||||
)
|
||||
|
||||
|
@@ -36,6 +36,7 @@ class WaterleakSensor(SmartModule):
|
||||
attribute_getter="status",
|
||||
icon="mdi:water",
|
||||
category=Feature.Category.Debug,
|
||||
type=Feature.Type.Sensor,
|
||||
)
|
||||
)
|
||||
self._add_feature(
|
||||
@@ -47,6 +48,7 @@ class WaterleakSensor(SmartModule):
|
||||
attribute_getter="alert",
|
||||
icon="mdi:water-alert",
|
||||
category=Feature.Category.Primary,
|
||||
type=Feature.Type.BinarySensor,
|
||||
)
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user