mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
Update mode, time, rssi and report_interval feature names/units (#995)
This commit is contained in:
parent
ac1e81dc17
commit
e083449049
@ -91,5 +91,5 @@ False
|
||||
True
|
||||
>>> for feat in dev.features.values():
|
||||
>>> 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
|
||||
"""
|
||||
|
@ -37,7 +37,7 @@ Light effect (light_effect): Off
|
||||
Light preset (light_preset): Not set
|
||||
Smooth transition on (smooth_transition_on): 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:
|
||||
|
||||
|
@ -352,6 +352,7 @@ class IotDevice(Device):
|
||||
name="On since",
|
||||
attribute_getter="on_since",
|
||||
icon="mdi:clock",
|
||||
category=Feature.Category.Info,
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -340,6 +340,7 @@ class IotStripPlug(IotPlug):
|
||||
name="On since",
|
||||
attribute_getter="on_since",
|
||||
icon="mdi:clock",
|
||||
category=Feature.Category.Info,
|
||||
)
|
||||
)
|
||||
for module in self._supported_modules.values():
|
||||
|
@ -26,6 +26,7 @@ class ReportMode(SmartModule):
|
||||
name="Report interval",
|
||||
container=self,
|
||||
attribute_getter="report_interval",
|
||||
unit="s",
|
||||
category=Feature.Category.Debug,
|
||||
)
|
||||
)
|
||||
|
@ -79,8 +79,8 @@ class TemperatureControl(SmartModule):
|
||||
self._add_feature(
|
||||
Feature(
|
||||
device,
|
||||
id="mode",
|
||||
name="Mode",
|
||||
id="thermostat_mode",
|
||||
name="Thermostat mode",
|
||||
container=self,
|
||||
attribute_getter="mode",
|
||||
category=Feature.Category.Primary,
|
||||
|
@ -25,11 +25,11 @@ class Time(SmartModule):
|
||||
self._add_feature(
|
||||
Feature(
|
||||
device=device,
|
||||
id="time",
|
||||
name="Time",
|
||||
id="device_time",
|
||||
name="Device time",
|
||||
attribute_getter="time",
|
||||
container=self,
|
||||
category=Feature.Category.Debug,
|
||||
category=Feature.Category.Info,
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -277,6 +277,7 @@ class SmartDevice(Device):
|
||||
name="RSSI",
|
||||
attribute_getter=lambda x: x._info["rssi"],
|
||||
icon="mdi:signal",
|
||||
unit="dBm",
|
||||
category=Feature.Category.Debug,
|
||||
)
|
||||
)
|
||||
@ -316,7 +317,7 @@ class SmartDevice(Device):
|
||||
name="On since",
|
||||
attribute_getter="on_since",
|
||||
icon="mdi:clock",
|
||||
category=Feature.Category.Info,
|
||||
category=Feature.Category.Debug,
|
||||
)
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user