Flexit BACnet: Cooker hood mode support (#138229)

This commit is contained in:
Piotr Buliński 2025-02-11 14:39:42 +01:00 committed by GitHub
parent 31ea2e1714
commit 2784a28ef7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 64 additions and 0 deletions

View File

@ -47,6 +47,12 @@
"state": {
"off": "mdi:fireplace-off"
}
},
"cooker_hood_mode": {
"default": "mdi:kettle-steam",
"state": {
"off": "mdi:kettle"
}
}
}
}

View File

@ -110,6 +110,9 @@
},
"fireplace_mode": {
"name": "Fireplace mode"
},
"cooker_hood_mode": {
"name": "Cooker hood mode"
}
}
}

View File

@ -47,6 +47,13 @@ SWITCHES: tuple[FlexitSwitchEntityDescription, ...] = (
turn_on_fn=lambda data: data.trigger_fireplace_mode(),
turn_off_fn=lambda data: data.trigger_fireplace_mode(),
),
FlexitSwitchEntityDescription(
key="cooker_hood_mode",
translation_key="cooker_hood_mode",
is_on_fn=lambda data: data.cooker_hood_status,
turn_on_fn=lambda data: data.activate_cooker_hood(),
turn_off_fn=lambda data: data.deactivate_cooker_hood(),
),
)

View File

@ -1,4 +1,52 @@
# serializer version: 1
# name: test_switches[switch.device_name_cooker_hood_mode-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': None,
'entity_id': 'switch.device_name_cooker_hood_mode',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <SwitchDeviceClass.SWITCH: 'switch'>,
'original_icon': None,
'original_name': 'Cooker hood mode',
'platform': 'flexit_bacnet',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'cooker_hood_mode',
'unique_id': '0000-0001-cooker_hood_mode',
'unit_of_measurement': None,
})
# ---
# name: test_switches[switch.device_name_cooker_hood_mode-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'switch',
'friendly_name': 'Device Name Cooker hood mode',
}),
'context': <ANY>,
'entity_id': 'switch.device_name_cooker_hood_mode',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_switches[switch.device_name_electric_heater-entry]
EntityRegistryEntrySnapshot({
'aliases': set({