From 8046c96b5417a70bf41b569c7bc62b9dbbe9ffd5 Mon Sep 17 00:00:00 2001 From: Teemu R Date: Sat, 16 Mar 2019 21:32:25 +0100 Subject: [PATCH] bulb: add the temperature range to state_information, inform the user if the info is missing when calling temperature (#163) --- pyHS100/cli.py | 3 +++ pyHS100/smartbulb.py | 1 + 2 files changed, 4 insertions(+) diff --git a/pyHS100/cli.py b/pyHS100/cli.py index 892331db..640397e3 100755 --- a/pyHS100/cli.py +++ b/pyHS100/cli.py @@ -217,6 +217,9 @@ def temperature(dev, temperature): click.echo("Color temperature: %s" % dev.color_temp) if dev.valid_temperature_range != (0, 0): click.echo("(min: %s, max: %s)" % dev.valid_temperature_range) + else: + click.echo("Temperature range unknown, please open a github issue" + " or a pull request for model '%s'" % dev.model) else: click.echo("Setting color temperature to %s" % temperature) dev.color_temp = temperature diff --git a/pyHS100/smartbulb.py b/pyHS100/smartbulb.py index 9664efec..dcdc98d2 100644 --- a/pyHS100/smartbulb.py +++ b/pyHS100/smartbulb.py @@ -285,6 +285,7 @@ class SmartBulb(SmartDevice): } # type: Dict[str, Any] if self.is_variable_color_temp: info["Color temperature"] = self.color_temp + info["Valid temperature range"] = self.valid_temperature_range if self.is_color: info["HSV"] = self.hsv