From d9ea799dd7eb75384c4e34cd22d65712e5f5ca57 Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Wed, 9 Nov 2022 23:10:00 +0100 Subject: [PATCH 1/3] Warn for setter not implemented --- miio/devicestatus.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/miio/devicestatus.py b/miio/devicestatus.py index 66f605f4d..08c7f9c36 100644 --- a/miio/devicestatus.py +++ b/miio/devicestatus.py @@ -199,7 +199,9 @@ def decorator_setting(func): property_name = func.__name__ if setter is None and setter_name is None: - raise Exception("Either setter or setter_name needs to be defined") + raise Exception("setter_name needs to be defined") + if setter_name is None: + raise Exception("setter not yet implemented, use setter_name instead") common_values = { "id": str(property_name), From 07388dbd3c24061299e18a8f2afae8e909524b15 Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Wed, 9 Nov 2022 23:43:13 +0100 Subject: [PATCH 2/3] Update miio/devicestatus.py Co-authored-by: Teemu R. --- miio/devicestatus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miio/devicestatus.py b/miio/devicestatus.py index 08c7f9c36..aa396a340 100644 --- a/miio/devicestatus.py +++ b/miio/devicestatus.py @@ -201,7 +201,7 @@ def decorator_setting(func): if setter is None and setter_name is None: raise Exception("setter_name needs to be defined") if setter_name is None: - raise Exception("setter not yet implemented, use setter_name instead") + raise NotImplementedError("setter not yet implemented, use setter_name instead") common_values = { "id": str(property_name), From 36f2dbe58fc21fc252d4e53fe0da1537af6652b9 Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Thu, 10 Nov 2022 00:06:21 +0100 Subject: [PATCH 3/3] fix black --- miio/devicestatus.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/miio/devicestatus.py b/miio/devicestatus.py index aa396a340..77ecef066 100644 --- a/miio/devicestatus.py +++ b/miio/devicestatus.py @@ -201,7 +201,9 @@ def decorator_setting(func): if setter is None and setter_name is None: raise Exception("setter_name needs to be defined") if setter_name is None: - raise NotImplementedError("setter not yet implemented, use setter_name instead") + raise NotImplementedError( + "setter not yet implemented, use setter_name instead" + ) common_values = { "id": str(property_name),