diff --git a/custom_components/localtuya/const.py b/custom_components/localtuya/const.py index 8bfd9686d..95311fa4e 100644 --- a/custom_components/localtuya/const.py +++ b/custom_components/localtuya/const.py @@ -57,6 +57,8 @@ CONF_COLOR_TEMP_MAX_KELVIN = "color_temp_max_kelvin" CONF_COLOR_TEMP_REVERSE = "color_temp_reverse" CONF_MUSIC_MODE = "music_mode" +CONF_CUST_SCENE = "scenes_availible" +CONF_CUST_FRIENDLY = "scenes_availible_friendly" # switch CONF_CURRENT = "current" @@ -108,6 +110,7 @@ CONF_IDLE_STATUS_VALUE = "idle_status_value" CONF_RETURNING_STATUS_VALUE = "returning_status_value" CONF_DOCKED_STATUS_VALUE = "docked_status_value" +CONF_CLEANING_STATUS_VALUE = "cleaning_status_value" CONF_BATTERY_DP = "battery_dp" CONF_MODE_DP = "mode_dp" CONF_MODES = "modes" diff --git a/custom_components/localtuya/light.py b/custom_components/localtuya/light.py index 7c74e49f5..5a687eb25 100644 --- a/custom_components/localtuya/light.py +++ b/custom_components/localtuya/light.py @@ -29,6 +29,8 @@ CONF_COLOR_TEMP_MIN_KELVIN, CONF_COLOR_TEMP_REVERSE, CONF_MUSIC_MODE, + CONF_CUST_SCENE, + CONF_CUST_FRIENDLY, ) _LOGGER = logging.getLogger(__name__) @@ -125,6 +127,8 @@ def flow_schema(dps): description={"suggested_value": DEFAULT_COLOR_TEMP_REVERSE}, ): bool, vol.Optional(CONF_SCENE): vol.In(dps), + vol.Optional(CONF_CUST_SCENE): str, + vol.Optional(CONF_CUST_FRIENDLY): str, vol.Optional( CONF_MUSIC_MODE, default=False, description={"suggested_value": False} ): bool, @@ -166,8 +170,14 @@ def __init__( self._effect = None self._effect_list = [] self._scenes = None + ##WiP if self.has_config(CONF_SCENE): - if self._config.get(CONF_SCENE) < 20: + if self.has_config(CONF_CUST_SCENE): + cust_vals = self._config[CONF_CUST_SCENE].split(",") + friendly_vals = self._config.get(CONF_CUST_FRIENDLY,self._config[CONF_CUST_SCENE]).split(",") + friendly_vals.extend(cust_vals[len(friendly_vals):]) + self._scenes = dict(zip(friendly_vals, cust_vals)) + elif self._config.get(CONF_SCENE) < 20: self._scenes = SCENE_LIST_RGBW_255 elif self._config.get(CONF_BRIGHTNESS) is None: self._scenes = SCENE_LIST_RGB_1000 @@ -248,7 +258,7 @@ def supported_features(self): """Flag supported features.""" supports = 0 if self.has_config(CONF_BRIGHTNESS): - supports |= SUPPORT_BRIGHTNESS + supports |= SUPPORT_BRIGHTNESS if self.has_config(CONF_COLOR_TEMP): supports |= SUPPORT_COLOR_TEMP if self.has_config(CONF_COLOR): diff --git a/custom_components/localtuya/translations/en.json b/custom_components/localtuya/translations/en.json index 1114a7399..35cf3cf48 100644 --- a/custom_components/localtuya/translations/en.json +++ b/custom_components/localtuya/translations/en.json @@ -163,6 +163,8 @@ "color_temp_max_kelvin": "Maximum Color Temperature in K", "music_mode": "Music mode available", "scene": "Scene", + "scenes_availible": "Override Availible Scene Values (comma-separated)", + "scenes_availible_friendly": "Overridden Scene Names (comma-separated)", "select_options": "Valid entries, separate entries by a ;", "select_options_friendly": "User Friendly options, separate entries by a ;", "fan_speed_control": "Fan Speed Control dps", diff --git a/custom_components/localtuya/translations/it.json b/custom_components/localtuya/translations/it.json index ce0664013..c9e8134e6 100644 --- a/custom_components/localtuya/translations/it.json +++ b/custom_components/localtuya/translations/it.json @@ -160,6 +160,8 @@ "color_temp_max_kelvin": "Massima temperatura di colore in k", "music_mode": "Modalità musicale disponibile", "scene": "Scena", + "scenes_availible": "Sostituisci i valori della scena disponibili (separato da virgola)", + "scenes_availible_friendly": "Nomi delle scene sostituiti (separato da virgola)", "select_options": "Opzioni valide, voci separate da una vigola (;)", "select_options_friendly": "Opzioni intuitive, voci separate da una virgola", "fan_speed_control": "DP di controllo di velocità del ventilatore", diff --git a/custom_components/localtuya/translations/pt-BR.json b/custom_components/localtuya/translations/pt-BR.json index 0bbd6cabd..dbffc5dd1 100644 --- a/custom_components/localtuya/translations/pt-BR.json +++ b/custom_components/localtuya/translations/pt-BR.json @@ -160,6 +160,8 @@ "color_temp_max_kelvin": "Temperatura máxima de cor em K", "music_mode": "Modo de música disponível", "scene": "Cena", + "scenes_availible": "Substituir valores de cena disponíveis (separados por vírgula)", + "scenes_availible_friendly": "Nomes de cenas substituídos (separados por vírgulas)", "select_options": "Entradas válidas, entradas separadas por um ;", "select_options_friendly": "Opções fantasia ​​ao usuário, entradas separadas por um ;", "fan_speed_control": "Dps de controle de velocidade do ventilador", diff --git a/custom_components/localtuya/vacuum.py b/custom_components/localtuya/vacuum.py index 0d0ec8cb5..51d678e4c 100644 --- a/custom_components/localtuya/vacuum.py +++ b/custom_components/localtuya/vacuum.py @@ -22,6 +22,7 @@ CONF_CLEAN_RECORD_DP, CONF_CLEAN_TIME_DP, CONF_DOCKED_STATUS_VALUE, + CONF_CLEANING_STATUS_VALUE, CONF_FAN_SPEED_DP, CONF_FAN_SPEEDS, CONF_FAULT_DP, @@ -52,6 +53,7 @@ DEFAULT_RETURNING_STATUS = "docking" DEFAULT_DOCKED_STATUS = "charging,chargecompleted" DEFAULT_MODES = "smart,wall_follow,spiral,single" +DEFAULT_CLEANING_STATUS = "smart_clean,zone_clean,part_clean,wallfollow,selectroom" DEFAULT_FAN_SPEEDS = "low,normal,high" DEFAULT_PAUSED_STATE = "paused" DEFAULT_RETURN_MODE = "chargego"