Skip to content

Commit

Permalink
Adjust auto configure heaters "qn" category.
Browse files Browse the repository at this point in the history
  • Loading branch information
xZetsubou committed Apr 27, 2024
1 parent c98d0c3 commit 5c170a1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions custom_components/localtuya/core/ha_entities/climates.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
CONF_FAN_SPEED_LIST,
CONF_FAN_SPEED_DP,
CONF_TARGET_TEMPERATURE_DP,
CONF_PRESET_DP,
)


Expand Down Expand Up @@ -71,7 +72,7 @@ def localtuya_climate(
),
CONF_FAN_SPEED_LIST: CLOUD_VALUE(fans_speeds, CONF_FAN_SPEED_DP, "range", str),
CONF_ECO_VALUE: echo_value,
CONF_PRESET_SET: preset_set,
CONF_PRESET_SET: CLOUD_VALUE(preset_set, CONF_PRESET_DP, "range", dict),
CONF_TEMPERATURE_UNIT: unit,
CONF_PRECISION: CLOUD_VALUE(
str(values_precsion), CONF_CURRENT_TEMPERATURE_DP, "scale", str
Expand Down Expand Up @@ -148,18 +149,19 @@ def localtuya_climate(
id=DPCode.SWITCH,
target_temperature_dp=(DPCode.TEMP_SET_F, DPCode.TEMP_SET),
current_temperature_dp=(DPCode.TEMP_CURRENT, DPCode.TEMP_CURRENT_F),
hvac_mode_dp=DPCode.SWITCH,
hvac_action_dp=(DPCode.WORK_STATE, DPCode.WORK_MODE, DPCode.WORK_STATUS),
preset_dp=DPCode.MODE,
fan_speed_dp=(DPCode.FAN_SPEED_ENUM, DPCode.WINDSPEED),
custom_configs=localtuya_climate(
hvac_mode_set={
HVACMode.OFF: "off",
HVACMode.HEAT: "hot",
HVACMode.OFF: False,
HVACMode.HEAT: True,
},
temp_step=1,
actions_set={
HVACAction.HEATING: "heating",
HVACAction.IDLE: "warming",
HVACAction.HEATING: True,
HVACAction.IDLE: False,
},
values_precsion=0.1,
target_precision=0.1,
Expand Down

0 comments on commit 5c170a1

Please sign in to comment.