Update mode, time, rssi and report_interval feature names/units (#995)

This commit is contained in:
Steven B 2024-06-21 17:42:43 +01:00 committed by GitHub
parent ac1e81dc17
commit e083449049
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 12 additions and 8 deletions

View File

@ -91,5 +91,5 @@ False
True True
>>> for feat in dev.features.values(): >>> for feat in dev.features.values():
>>> print(f"{feat.name}: {feat.value}") >>> print(f"{feat.name}: {feat.value}")
Device ID: 0000000000000000000000000000000000000000\nState: True\nSignal Level: 2\nRSSI: -52\nSSID: #MASKED_SSID#\nOverheated: False\nBrightness: 50\nCloud connection: True\nHSV: HSV(hue=0, saturation=100, value=50)\nColor temperature: 2700\nAuto update enabled: True\nUpdate available: False\nCurrent firmware version: 1.1.6 Build 240130 Rel.173828\nAvailable firmware version: 1.1.6 Build 240130 Rel.173828\nLight effect: Party\nLight preset: Light preset 1\nSmooth transition on: 2\nSmooth transition off: 2\nTime: 2024-02-23 02:40:15+01:00 Device ID: 0000000000000000000000000000000000000000\nState: True\nSignal Level: 2\nRSSI: -52\nSSID: #MASKED_SSID#\nOverheated: False\nBrightness: 50\nCloud connection: True\nHSV: HSV(hue=0, saturation=100, value=50)\nColor temperature: 2700\nAuto update enabled: True\nUpdate available: False\nCurrent firmware version: 1.1.6 Build 240130 Rel.173828\nAvailable firmware version: 1.1.6 Build 240130 Rel.173828\nLight effect: Party\nLight preset: Light preset 1\nSmooth transition on: 2\nSmooth transition off: 2\nDevice time: 2024-02-23 02:40:15+01:00
""" """

View File

@ -37,7 +37,7 @@ Light effect (light_effect): Off
Light preset (light_preset): Not set Light preset (light_preset): Not set
Smooth transition on (smooth_transition_on): 2 Smooth transition on (smooth_transition_on): 2
Smooth transition off (smooth_transition_off): 2 Smooth transition off (smooth_transition_off): 2
Time (time): 2024-02-23 02:40:15+01:00 Device time (device_time): 2024-02-23 02:40:15+01:00
To see whether a device supports a feature, check for the existence of it: To see whether a device supports a feature, check for the existence of it:

View File

@ -352,6 +352,7 @@ class IotDevice(Device):
name="On since", name="On since",
attribute_getter="on_since", attribute_getter="on_since",
icon="mdi:clock", icon="mdi:clock",
category=Feature.Category.Info,
) )
) )

View File

@ -340,6 +340,7 @@ class IotStripPlug(IotPlug):
name="On since", name="On since",
attribute_getter="on_since", attribute_getter="on_since",
icon="mdi:clock", icon="mdi:clock",
category=Feature.Category.Info,
) )
) )
for module in self._supported_modules.values(): for module in self._supported_modules.values():

View File

@ -26,6 +26,7 @@ class ReportMode(SmartModule):
name="Report interval", name="Report interval",
container=self, container=self,
attribute_getter="report_interval", attribute_getter="report_interval",
unit="s",
category=Feature.Category.Debug, category=Feature.Category.Debug,
) )
) )

View File

@ -79,8 +79,8 @@ class TemperatureControl(SmartModule):
self._add_feature( self._add_feature(
Feature( Feature(
device, device,
id="mode", id="thermostat_mode",
name="Mode", name="Thermostat mode",
container=self, container=self,
attribute_getter="mode", attribute_getter="mode",
category=Feature.Category.Primary, category=Feature.Category.Primary,

View File

@ -25,11 +25,11 @@ class Time(SmartModule):
self._add_feature( self._add_feature(
Feature( Feature(
device=device, device=device,
id="time", id="device_time",
name="Time", name="Device time",
attribute_getter="time", attribute_getter="time",
container=self, container=self,
category=Feature.Category.Debug, category=Feature.Category.Info,
) )
) )

View File

@ -277,6 +277,7 @@ class SmartDevice(Device):
name="RSSI", name="RSSI",
attribute_getter=lambda x: x._info["rssi"], attribute_getter=lambda x: x._info["rssi"],
icon="mdi:signal", icon="mdi:signal",
unit="dBm",
category=Feature.Category.Debug, category=Feature.Category.Debug,
) )
) )
@ -316,7 +317,7 @@ class SmartDevice(Device):
name="On since", name="On since",
attribute_getter="on_since", attribute_getter="on_since",
icon="mdi:clock", icon="mdi:clock",
category=Feature.Category.Info, category=Feature.Category.Debug,
) )
) )