Re-map light brightness range

Home Assistant uses brightness range 0-255 whilst Tuya somewhere around
29-1092. This commit maps brightness between these two ranges.
This commit is contained in:
Pierre Ståhl
2020-10-13 22:17:41 +02:00
parent 47d2900a2c
commit 15a79ec690
3 changed files with 65 additions and 19 deletions

View File

@@ -8,6 +8,10 @@ CONF_LOCAL_KEY = "local_key"
CONF_PROTOCOL_VERSION = "protocol_version"
CONF_DPS_STRINGS = "dps_strings"
# light
CONF_BRIGHTNESS_LOWER = "brightness_lower"
CONF_BRIGHTNESS_UPPER = "brightness_upper"
# switch
CONF_CURRENT = "current"
CONF_CURRENT_CONSUMPTION = "current_consumption"