Add sound switch to Tuya fan light (#150879)

This commit is contained in:
epenet
2025-08-19 14:20:05 +02:00
committed by GitHub
parent c62c52e8cf
commit 69dbcb0627
2 changed files with 57 additions and 0 deletions

View File

@@ -227,6 +227,15 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
), ),
# Ceiling Fan Light
# https://developer.tuya.com/en/docs/iot/fsd?id=Kaof8eiei4c2v
"fsd": (
SwitchEntityDescription(
key=DPCode.FAN_BEEP,
translation_key="sound",
entity_category=EntityCategory.CONFIG,
),
),
# Irrigator # Irrigator
# https://developer.tuya.com/en/docs/iot/categoryggq?id=Kaiuz1qib7z0k # https://developer.tuya.com/en/docs/iot/categoryggq?id=Kaiuz1qib7z0k
"ggq": ( "ggq": (

View File

@@ -2369,6 +2369,54 @@
'state': 'off', 'state': 'off',
}) })
# --- # ---
# name: test_platform_setup_and_discovery[switch.ceiling_fan_light_v2_sound-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'switch.ceiling_fan_light_v2_sound',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Sound',
'platform': 'tuya',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'sound',
'unique_id': 'tuya.6wxksqu35c61sce9dsffan_beep',
'unit_of_measurement': None,
})
# ---
# name: test_platform_setup_and_discovery[switch.ceiling_fan_light_v2_sound-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'ceiling fan/Light v2 Sound',
}),
'context': <ANY>,
'entity_id': 'switch.ceiling_fan_light_v2_sound',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_platform_setup_and_discovery[switch.clima_cucina_child_lock-entry] # name: test_platform_setup_and_discovery[switch.clima_cucina_child_lock-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({