From ac1078fcbc73fb8a129f42dd9229cf4c16518fd8 Mon Sep 17 00:00:00 2001 From: "Jason A. Cox" Date: Sun, 29 Jan 2023 13:24:06 -0800 Subject: [PATCH 1/3] Remove bulb attr based blocks to set_*() #265 --- tinytuya/BulbDevice.py | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/tinytuya/BulbDevice.py b/tinytuya/BulbDevice.py index 60abd17a..ddbf52c0 100644 --- a/tinytuya/BulbDevice.py +++ b/tinytuya/BulbDevice.py @@ -312,9 +312,8 @@ def set_colour(self, r, g, b, nowait=False): nowait(bool): True to send without waiting for response. """ if not self.has_colour: - return error_json( - ERR_FUNCTION, "set_colour: Device does not support color." - ) + log.debug("set_colour: Device does not appear to support color.") + # return error_json(ERR_FUNCTION, "set_colour: Device does not support color.") if not 0 <= r <= 255: return error_json( ERR_RANGE, @@ -354,22 +353,21 @@ def set_hsv(self, h, s, v, nowait=False): nowait(bool): True to send without waiting for response. """ if not self.has_colour: - return error_json( - ERR_FUNCTION, "set_colour: Device does not support color." - ) + log.debug("set_hsv: Device does not appear to support color.") + # return error_json(ERR_FUNCTION, "set_hsv: Device does not support color.") if not 0 <= h <= 1.0: return error_json( - ERR_RANGE, "set_colour: The value for Hue needs to be between 0 and 1." + ERR_RANGE, "set_hsv: The value for Hue needs to be between 0 and 1." ) if not 0 <= s <= 1.0: return error_json( ERR_RANGE, - "set_colour: The value for Saturation needs to be between 0 and 1.", + "set_hsv: The value for Saturation needs to be between 0 and 1.", ) if not 0 <= v <= 1.0: return error_json( ERR_RANGE, - "set_colour: The value for Value needs to be between 0 and 1.", + "set_hsv: The value for Value needs to be between 0 and 1.", ) (r, g, b) = colorsys.hsv_to_rgb(h, s, v) @@ -521,9 +519,8 @@ def set_brightness(self, brightness, nowait=False): if state["mode"] == "white": # for white mode use DPS for brightness if not self.has_brightness: - return error_json( - ERR_FUNCTION, "set_colour: Device does not support brightness." - ) + log.debug("set_brightness: Device does not appear to support brightness.") + # return error_json(ERR_FUNCTION, "set_brightness: Device does not support brightness.") payload = self.generate_payload( CONTROL, {self.DPS_INDEX_BRIGHTNESS[self.bulb_type]: brightness} ) @@ -572,9 +569,8 @@ def set_colourtemp(self, colourtemp, nowait=False): nowait(bool): True to send without waiting for response. """ if not self.has_colourtemp: - return error_json( - ERR_FUNCTION, "set_colourtemp: Device does not support colortemp." - ) + log.debug("set_colourtemp: Device does not appear to support colortemp.") + # return error_json(ERR_FUNCTION, "set_colourtemp: Device does not support colortemp.") if self.bulb_type == "A" and not 0 <= colourtemp <= 255: return error_json( ERR_RANGE, From 8b2835e47958bea672978ad8cee2f32aa833fe9f Mon Sep 17 00:00:00 2001 From: "Jason A. Cox" Date: Sun, 29 Jan 2023 13:33:57 -0800 Subject: [PATCH 2/3] v1.10.1 --- RELEASE.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELEASE.md b/RELEASE.md index c1044a2c..2315202b 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,5 +1,11 @@ # RELEASE NOTES +## v1.10.1 - Bug Fix for BulbDevice and Zigbee Devices + +* PyPI 1.10.1 +* Fix _process_message() missing parameters discovered via issue https://github.com/jasonacox/tinytuya/issues/266 by @jasonacox in https://github.com/jasonacox/tinytuya/pull/267 +* Removed bulb attribute conditional blocking in BulbDevice set_colour(), set_hsv() and set_colourtemp() as some devices do not correctly report capabilities. Conditional provides debug warning message instead by @jasonacox in https://github.com/jasonacox/tinytuya/issues/265 + ## v1.10.0 - Tuya Protocol v3.5 Device Support / Scanner Rewrite * PyPI 1.10.0 From ebe8be61b7f38085f36523c6eb50ec317d00c877 Mon Sep 17 00:00:00 2001 From: "Jason A. Cox" Date: Sun, 29 Jan 2023 13:39:49 -0800 Subject: [PATCH 3/3] v1.10.1 --- tinytuya/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinytuya/core.py b/tinytuya/core.py index 3ed37d65..9580aeb5 100644 --- a/tinytuya/core.py +++ b/tinytuya/core.py @@ -83,7 +83,7 @@ # Colorama terminal color capability for all platforms init() -version_tuple = (1, 10, 0) +version_tuple = (1, 10, 1) version = __version__ = "%d.%d.%d" % version_tuple __author__ = "jasonacox"