Skip to content

Commit

Permalink
adjust auto-configure fan #116
Browse files Browse the repository at this point in the history
  • Loading branch information
xZetsubou committed Jan 28, 2024
1 parent 746db6d commit 626be63
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/localtuya/core/ha_entities/fans.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def localtuya_fan(fwd, rev, min_speed, max_speed, order, dp_type):
fan_direction=DPCode.FAN_DIRECTION,
fan_oscillating_control=FANS_OSCILLATING,
custom_configs=localtuya_fan(
DIRECTION_FORWARD, DIRECTION_REVERSE, 1, 100, "disabled", "str"
DIRECTION_FORWARD, DIRECTION_REVERSE, 1, 100, "disabled", "int"
),
),
)
Expand Down
11 changes: 10 additions & 1 deletion custom_components/localtuya/core/ha_entities/selects.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def localtuya_selector(options):
"6": "6 Hours",
}
COUNT_DOWN_HOURS = {
"cancel": "Disable",
"off": "Disable",
"1h": "1 Hour",
"2h": "2 Hours",
"3h": "3 Hours",
Expand Down Expand Up @@ -590,6 +590,15 @@ def localtuya_selector(options):
# Fan
# https://developer.tuya.com/en/docs/iot/f?id=K9gf45vs7vkge
"fs": (
LocalTuyaEntity(
id=DPCode.MODE,
entity_category=EntityCategory.CONFIG,
icon="mdi:cog",
name="Mode",
custom_configs=localtuya_selector(
{"sleep": "Sleep", "normal": "Normal", "nature": "Nature"}
),
),
LocalTuyaEntity(
id=DPCode.FAN_VERTICAL,
entity_category=EntityCategory.CONFIG,
Expand Down

0 comments on commit 626be63

Please sign in to comment.