Skip to content

Commit

Permalink
localtuya: Add support for xktyd
Browse files Browse the repository at this point in the history
  • Loading branch information
SKULSHADY committed Jan 9, 2025
1 parent 4ecf43d commit dbf4afb
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
11 changes: 11 additions & 0 deletions custom_components/localtuya/core/ha_entities/fans.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ def localtuya_fan(fwd, rev, min_speed, max_speed, order, dp_type):
),
),
),
"xktyd": (
LocalTuyaEntity(
id=DPCode.FAN_SWITCH,
name="Motion",
icon="mdi:rotate-orbit",
fan_speed_control=FAN_SPEED_DP,
custom_configs=localtuya_fan(
DIRECTION_FORWARD, DIRECTION_REVERSE, 1, 100, "disabled", "int"
),
),
),
}
# Fan with Light
FANS["fsd"] = FANS["fs"]
Expand Down
10 changes: 10 additions & 0 deletions custom_components/localtuya/core/ha_entities/lights.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,16 @@ def localtuya_light(
custom_configs=localtuya_light(29, 1000, 2700, 6500, False, False),
),
),
"xktyd": (
LocalTuyaEntity(
id=DPCode.SWITCH_LED,
icon="mdi:creation-outline",
name="Nebula",
brightness=(DPCode.BRIGHT_VALUE_V2, DPCode.BRIGHT_VALUE),
color=(DPCode.COLOUR_DATA_V2, DPCode.COLOUR_DATA),
custom_configs=localtuya_light(0, 1000, 2700, 6500, False, False),
),
),
}

# HDMI Sync Box A1
Expand Down
10 changes: 10 additions & 0 deletions custom_components/localtuya/core/ha_entities/numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,16 @@ def localtuya_numbers(_min, _max, _step=1, _scale=1, unit=None) -> dict:
entity_category=EntityCategory.CONFIG,
),
),
"xktyd": (
LocalTuyaEntity(
id=DPCode.COUNTDOWN,
name="Timer",
icon="mdi:timer-outline",
device_class=NumberDeviceClass.DURATION,
entity_category=EntityCategory.CONFIG,
custom_configs=localtuya_numbers(0, 86400, 1, 1, UnitOfTime.SECONDS),
),
),
}

# Wireless Switch # also can come as knob switch.
Expand Down

0 comments on commit dbf4afb

Please sign in to comment.