FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update mode, time, rssi and report_interval feature names/units by sdb9696 · Pull Request #995 · python-kasa/python-kasa · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (8) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion docs/tutorial.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@
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
"""
2 changes: 1 addition & 1 deletion kasa/feature.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
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:

Expand Down
1 change: 1 addition & 0 deletions kasa/iot/iotdevice.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ async def _initialize_features(self):
name="On since",
attribute_getter="on_since",
icon="mdi:clock",
category=Feature.Category.Info,
)
)

Expand Down
1 change: 1 addition & 0 deletions kasa/iot/iotstrip.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ async def _initialize_features(self):
name="On since",
attribute_getter="on_since",
icon="mdi:clock",
category=Feature.Category.Info,
)
)
for module in self._supported_modules.values():
Expand Down
1 change: 1 addition & 0 deletions kasa/smart/modules/reportmode.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def __init__(self, device: SmartDevice, module: str):
name="Report interval",
container=self,
attribute_getter="report_interval",
unit="s",
category=Feature.Category.Debug,
)
)
Expand Down
4 changes: 2 additions & 2 deletions kasa/smart/modules/temperaturecontrol.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def __init__(self, device: SmartDevice, module: str):
self._add_feature(
Feature(
device,
id="mode",
name="Mode",
id="thermostat_mode",
name="Thermostat mode",
container=self,
attribute_getter="mode",
category=Feature.Category.Primary,
Expand Down
6 changes: 3 additions & 3 deletions kasa/smart/modules/time.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ def __init__(self, device: SmartDevice, module: str):
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,
)
)

Expand Down
3 changes: 2 additions & 1 deletion kasa/smart/smartdevice.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ async def _initialize_features(self):
name="RSSI",
attribute_getter=lambda x: x._info["rssi"],
icon="mdi:signal",
unit="dBm",
category=Feature.Category.Debug,
)
)
Expand Down Expand Up @@ -316,7 +317,7 @@ async def _initialize_features(self):
name="On since",
attribute_getter="on_since",
icon="mdi:clock",
category=Feature.Category.Info,
category=Feature.Category.Debug,
)
)

Expand Down

Back | FazBrowse Home | New Git URL