From 3076022c6524862c7ff5378deb9e1dcc88b96d33 Mon Sep 17 00:00:00 2001 From: Teemu Rytilahti Date: Fri, 21 Jun 2024 19:02:16 +0200 Subject: [PATCH 1/2] Improve autooff parameters --- kasa/smart/modules/autooff.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kasa/smart/modules/autooff.py b/kasa/smart/modules/autooff.py index afb822c56..5af4f25d2 100644 --- a/kasa/smart/modules/autooff.py +++ b/kasa/smart/modules/autooff.py @@ -40,11 +40,12 @@ def _initialize_features(self): Feature( self._device, id="auto_off_minutes", - name="Auto off minutes", + name="Auto off in", container=self, attribute_getter="delay", attribute_setter="set_delay", type=Feature.Type.Number, + unit="minutes", ) ) self._add_feature( From 7df72ea4d0b3fd08c617343a4ca074b4f074d6dc Mon Sep 17 00:00:00 2001 From: Teemu Rytilahti Date: Fri, 21 Jun 2024 19:39:50 +0200 Subject: [PATCH 2/2] Fix unit to follow ha's UnitOfTime.MINUTES --- kasa/smart/modules/autooff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kasa/smart/modules/autooff.py b/kasa/smart/modules/autooff.py index 5af4f25d2..47f69d069 100644 --- a/kasa/smart/modules/autooff.py +++ b/kasa/smart/modules/autooff.py @@ -45,7 +45,7 @@ def _initialize_features(self): attribute_getter="delay", attribute_setter="set_delay", type=Feature.Type.Number, - unit="minutes", + unit="min", # ha-friendly unit, see UnitOfTime.MINUTES ) ) self._add_feature(