From 2b34b9efc6fae7bccdc2d58657fd386fc50fb4d8 Mon Sep 17 00:00:00 2001 From: Steven B <51370195+sdb9696@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:48:45 +0000 Subject: [PATCH] Add missed saves --- docs/tutorial.py | 4 ++-- kasa/device.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/tutorial.py b/docs/tutorial.py index e0cafb22..2b35ec77 100644 --- a/docs/tutorial.py +++ b/docs/tutorial.py @@ -52,9 +52,9 @@ True >>> await dev.update() >>> light.brightness 50 ->>> light.has_feature(light.set_hsv) +>>> light.has_feature("hsv") True ->>> if light.has_feature(light.set_hsv): +>>> if light.has_feature("hsv"): >>> print(light.hsv) HSV(hue=0, saturation=100, value=50) diff --git a/kasa/device.py b/kasa/device.py index fd28c6f1..58fea7ff 100644 --- a/kasa/device.py +++ b/kasa/device.py @@ -529,23 +529,23 @@ class Device(ABC): vals: dict[str, tuple[ModuleName, Callable[[Any], Any], str]] = { "is_dimmable": ( Module.Light, - lambda c: c.has_feature("set_brightness"), - "light_module.has_feature('set_brightness')", + lambda c: c.has_feature("brightness"), + "light_module.has_feature('brightness')", ), "is_color": ( Module.Light, - lambda c: c.has_feature("set_hsv"), - "light_module.has_feature('set_hsv')", + lambda c: c.has_feature("hsv"), + "light_module.has_feature('hsv')", ), "is_variable_color_temp": ( Module.Light, - lambda c: c.has_feature("set_color_temp"), - "light_module.has_feature('set_color_temp')", + lambda c: c.has_feature("color_temp"), + "light_module.has_feature('color_temp')", ), "valid_temperature_range": ( Module.Light, lambda c: c._deprecated_valid_temperature_range(), - "minimum and maximum value of get_feature('set_color_temp')", + "minimum and maximum value of get_feature('color_temp')", ), "has_effects": ( Module.Light,