From 6869395bd114f823abacb551e9e6b248b656e0e2 Mon Sep 17 00:00:00 2001 From: sdb9696 Date: Sun, 23 Jun 2024 06:59:18 +0100 Subject: [PATCH] Fix smart led status to report rule status --- kasa/smart/modules/led.py | 2 +- kasa/tests/test_cli.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kasa/smart/modules/led.py b/kasa/smart/modules/led.py index 230b83d9f..2d0a354c0 100644 --- a/kasa/smart/modules/led.py +++ b/kasa/smart/modules/led.py @@ -27,7 +27,7 @@ def mode(self): @property def led(self): """Return current led status.""" - return self.data["led_status"] + return self.data["led_rule"] != "never" async def set_led(self, enable: bool): """Set led. diff --git a/kasa/tests/test_cli.py b/kasa/tests/test_cli.py index 1973c8248..091c76a1a 100644 --- a/kasa/tests/test_cli.py +++ b/kasa/tests/test_cli.py @@ -890,7 +890,7 @@ async def test_feature_set(mocker, runner): ) led_setter.assert_called_with(True) - assert "Changing led from False to True" in res.output + assert "Changing led from True to True" in res.output assert res.exit_code == 0