mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 19:57:03 -04:00
Add HDFury IP interrupt switch (#193408)
This commit is contained in:
@@ -105,6 +105,9 @@
|
||||
"htpcmode3": {
|
||||
"default": "mdi:desktop-classic"
|
||||
},
|
||||
"ipinterrupt": {
|
||||
"default": "mdi:console-network"
|
||||
},
|
||||
"iractive": {
|
||||
"default": "mdi:remote"
|
||||
},
|
||||
|
||||
@@ -161,6 +161,9 @@
|
||||
"htpcmode3": {
|
||||
"name": "HTPC mode RX3"
|
||||
},
|
||||
"ipinterrupt": {
|
||||
"name": "IP interrupt"
|
||||
},
|
||||
"iractive": {
|
||||
"name": "Infrared"
|
||||
},
|
||||
|
||||
@@ -131,6 +131,13 @@ SWITCHES: tuple[HDFurySwitchEntityDescription, ...] = (
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
set_value_fn=lambda client, value: client.set_tx1_force_5v(value),
|
||||
),
|
||||
HDFurySwitchEntityDescription(
|
||||
key="ipinterrupt",
|
||||
translation_key="ipinterrupt",
|
||||
entity_registry_enabled_default=False,
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
set_value_fn=lambda client, value: client.set_ip_interrupt(value),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ def mock_hdfury_client() -> Generator[AsyncMock]:
|
||||
"mutetx1": "1",
|
||||
"relay": "0",
|
||||
"macaddr": "c7:1c:df:9d:f6:40",
|
||||
"ipinterrupt": "0",
|
||||
"reboottimer": "0",
|
||||
"unmutecnt": "500",
|
||||
"earcunmutecnt": "0",
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
'htpcmode1': '0',
|
||||
'htpcmode2': '0',
|
||||
'htpcmode3': '0',
|
||||
'ipinterrupt': '0',
|
||||
'iractive': '1',
|
||||
'macaddr': 'c7:1c:df:9d:f6:40',
|
||||
'mutetx0': '1',
|
||||
|
||||
@@ -549,6 +549,56 @@
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_switch_entities[switch.hdfury_vrroom_02_ip_interrupt-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': None,
|
||||
'device_class': None,
|
||||
'device_id': <DeviceEntry connections=[('mac', 'c7:1c:df:9d:f6:40')]>,
|
||||
'disabled_by': None,
|
||||
'domain': 'switch',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'switch.hdfury_vrroom_02_ip_interrupt',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'IP interrupt',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'IP interrupt',
|
||||
'platform': 'hdfury',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'ipinterrupt',
|
||||
'unique_id': '000123456789_ipinterrupt',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_switch_entities[switch.hdfury_vrroom_02_ip_interrupt-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'HDFury VRROOM-02 IP interrupt',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.hdfury_vrroom_02_ip_interrupt',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_switch_entities[switch.hdfury_vrroom_02_mute_audio_tx0-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
|
||||
@@ -62,6 +62,8 @@ async def test_switch_entities(
|
||||
("switch.hdfury_vrroom_02_tx0_force_5v", "set_tx0_force_5v", SERVICE_TURN_OFF),
|
||||
("switch.hdfury_vrroom_02_tx1_force_5v", "set_tx1_force_5v", SERVICE_TURN_ON),
|
||||
("switch.hdfury_vrroom_02_tx1_force_5v", "set_tx1_force_5v", SERVICE_TURN_OFF),
|
||||
("switch.hdfury_vrroom_02_ip_interrupt", "set_ip_interrupt", SERVICE_TURN_ON),
|
||||
("switch.hdfury_vrroom_02_ip_interrupt", "set_ip_interrupt", SERVICE_TURN_OFF),
|
||||
],
|
||||
)
|
||||
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
|
||||
|
||||
Reference in New Issue
Block a user