From 27a6ed9b5138fbca68eda1a2e9209e9614282b89 Mon Sep 17 00:00:00 2001 From: xZetsubou Date: Sat, 2 Mar 2024 03:58:38 +0300 Subject: [PATCH] Auto Confgire: Fix scale type. #155 --- custom_components/localtuya/core/ha_entities/__init__.py | 2 +- custom_components/localtuya/core/ha_entities/selects.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/localtuya/core/ha_entities/__init__.py b/custom_components/localtuya/core/ha_entities/__init__.py index c1b6f05cf..0f8aecf67 100644 --- a/custom_components/localtuya/core/ha_entities/__init__.py +++ b/custom_components/localtuya/core/ha_entities/__init__.py @@ -186,7 +186,7 @@ def get_dp_values(dp: str, dps_data: dict, req_info: CLOUD_VALUE = None) -> dict # We only need the scaling factor, other values will be scaled from via later on. # dp_values["min"] = scale(dp_values.get("min"), val_scale) pref_type = req_info.prefer_type or int - val_scale = pref_type(dp_values.get("scale", 1)) + val_scale = dp_values.get("scale", 1) dp_values["min"] = pref_type(dp_values.get("min")) dp_values["max"] = pref_type(dp_values.get("max")) dp_values["step"] = pref_type(dp_values.get("step")) diff --git a/custom_components/localtuya/core/ha_entities/selects.py b/custom_components/localtuya/core/ha_entities/selects.py index 231a7f1fa..806631010 100644 --- a/custom_components/localtuya/core/ha_entities/selects.py +++ b/custom_components/localtuya/core/ha_entities/selects.py @@ -944,6 +944,7 @@ def localtuya_selector(options): icon="mdi:file-chart-outline", ), ), + # HDMI Sync Box A1 "hdmipmtbq": ( LocalTuyaEntity( id=DPCode.VIDEO_SCENE,