mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-23 03:33:35 +00:00
bulb: add the temperature range to state_information, inform the user if the info is missing when calling temperature (#163)
This commit is contained in:
parent
07b4eda7ae
commit
8046c96b54
@ -217,6 +217,9 @@ def temperature(dev, temperature):
|
|||||||
click.echo("Color temperature: %s" % dev.color_temp)
|
click.echo("Color temperature: %s" % dev.color_temp)
|
||||||
if dev.valid_temperature_range != (0, 0):
|
if dev.valid_temperature_range != (0, 0):
|
||||||
click.echo("(min: %s, max: %s)" % dev.valid_temperature_range)
|
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:
|
else:
|
||||||
click.echo("Setting color temperature to %s" % temperature)
|
click.echo("Setting color temperature to %s" % temperature)
|
||||||
dev.color_temp = temperature
|
dev.color_temp = temperature
|
||||||
|
@ -285,6 +285,7 @@ class SmartBulb(SmartDevice):
|
|||||||
} # type: Dict[str, Any]
|
} # type: Dict[str, Any]
|
||||||
if self.is_variable_color_temp:
|
if self.is_variable_color_temp:
|
||||||
info["Color temperature"] = self.color_temp
|
info["Color temperature"] = self.color_temp
|
||||||
|
info["Valid temperature range"] = self.valid_temperature_range
|
||||||
if self.is_color:
|
if self.is_color:
|
||||||
info["HSV"] = self.hsv
|
info["HSV"] = self.hsv
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user