Skip to content

Commit

Permalink
Remove Target DP As it the same DP as SET Humidity
Browse files Browse the repository at this point in the history
  • Loading branch information
xZetsubou committed Oct 25, 2023
1 parent d049f97 commit 767e716
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 1 addition & 6 deletions custom_components/localtuya/humidifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
CONF_HUMIDIFIER_SET_HUMIDITY_DP = "humidifier_set_humidity_dp"
CONF_HUMIDIFIER_CURRENT_HUMIDITY_DP = "humidifier_current_humidity_dp"
CONF_HUMIDIFIER_MODE_DP = "humidifier_mode_dp"
CONF_HUMIDIFIER_TARGET_HUMIDITY_DP = "humidifier_target_humidity_dp"
CONF_HUMIDIFIER_AVAILABLE_MODES = "humidifier_available_modes"

from .common import LocalTuyaEntity, async_setup_entry
Expand All @@ -37,9 +36,6 @@ def flow_schema(dps):
return {
vol.Optional(CONF_HUMIDIFIER_SET_HUMIDITY_DP): _col_to_select(dps, is_dps=True),
vol.Optional(CONF_HUMIDIFIER_MODE_DP): _col_to_select(dps, is_dps=True),
vol.Optional(CONF_HUMIDIFIER_TARGET_HUMIDITY_DP): _col_to_select(
dps, is_dps=True
),
vol.Required(ATTR_MIN_HUMIDITY, default=DEFAULT_MIN_HUMIDITY): int,
vol.Required(ATTR_MAX_HUMIDITY, default=DEFAULT_MAX_HUMIDITY): int,
vol.Optional(CONF_HUMIDIFIER_AVAILABLE_MODES): str,
Expand All @@ -54,7 +50,6 @@ class LocaltuyaHumidifier(LocalTuyaEntity, HumidifierEntity):
_dp_current_humidity = CONF_HUMIDIFIER_CURRENT_HUMIDITY_DP
_dp_mode = CONF_HUMIDIFIER_MODE_DP
_dp_set_humidity = CONF_HUMIDIFIER_SET_HUMIDITY_DP
_dp_target_humidity = CONF_HUMIDIFIER_TARGET_HUMIDITY_DP

def __init__(
self,
Expand Down Expand Up @@ -92,7 +87,7 @@ def mode(self) -> str | None:
@property
def target_humidity(self) -> int | None:
"""Return the humidity we try to reach."""
target_dp = self._config.get(self._dp_target_humidity, None)
target_dp = self._config.get(self._dp_set_humidity, None)

return self.dps_conf(target_dp) if target_dp else None

Expand Down
1 change: 0 additions & 1 deletion custom_components/localtuya/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@
"humidifier_current_humidity_dp": "Current Humidity DP",
"humidifier_mode_dp": "(optional) Set mode DP",
"humidifier_set_humidity_dp": "Set Humidity DP",
"humidifier_target_humidity_dp": "(optional) Set Humidity Target DP",
"min_humidity": "set the minimum supported humidity",
"max_humidity": "Set maximum supported humidity"
},
Expand Down

0 comments on commit 767e716

Please sign in to comment.