pull/34185/head
J. Nick Koston 2020-04-14 03:03:59 +00:00
parent 3ea41827f5
commit b895e24195
1 changed files with 2 additions and 2 deletions

View File

@ -731,9 +731,9 @@ def create_list_of_entities(config, request):
def hue_brightness_to_hass(value):
"""Convert hue brightness 1..254 to hass format 0..255."""
return min(255, round((value / HUE_API_STATE_HUE_MAX) * 255))
return min(255, round((value / HUE_API_STATE_BRI_MAX) * 255))
def hass_to_hue_brightness(value):
"""Convert hass brightness 0..255 to hue 1..254 scale."""
return max(1, round((value / 255) * HUE_API_STATE_HUE_MAX))
return max(1, round((value / 255) * HUE_API_STATE_BRI_MAX))