diff --git a/homeassistant/components/miele/binary_sensor.py b/homeassistant/components/miele/binary_sensor.py index 44a4c9f92d60..e6eb28f3e547 100644 --- a/homeassistant/components/miele/binary_sensor.py +++ b/homeassistant/components/miele/binary_sensor.py @@ -44,6 +44,7 @@ class MieleBinarySensorDefinition: BINARY_SENSOR_TYPES: Final[tuple[MieleBinarySensorDefinition, ...]] = ( MieleBinarySensorDefinition( types=( + MieleAppliance.COFFEE_SYSTEM, MieleAppliance.DISH_WARMER, MieleAppliance.DISHWASHER, MieleAppliance.FREEZER, diff --git a/tests/components/miele/snapshots/test_binary_sensor.ambr b/tests/components/miele/snapshots/test_binary_sensor.ambr index 09b9decdce4e..a9ee24f7ce65 100644 --- a/tests/components/miele/snapshots/test_binary_sensor.ambr +++ b/tests/components/miele/snapshots/test_binary_sensor.ambr @@ -2927,3 +2927,306 @@ 'state': 'off', }) # --- +# name: test_coffee_system_binary_sensor_states[platforms0-coffee_system.json][binary_sensor.coffee_system_door-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': None, + 'entity_id': 'binary_sensor.coffee_system_door', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Door', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Door', + 'platform': 'miele', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'DummyAppliance_CoffeeSystem-state_signal_door', + 'unit_of_measurement': None, + }) +# --- +# name: test_coffee_system_binary_sensor_states[platforms0-coffee_system.json][binary_sensor.coffee_system_door-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'door', + : 'Coffee system Door', + }), + 'context': , + 'entity_id': 'binary_sensor.coffee_system_door', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_coffee_system_binary_sensor_states[platforms0-coffee_system.json][binary_sensor.coffee_system_mobile_start-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.coffee_system_mobile_start', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Mobile start', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Mobile start', + 'platform': 'miele', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'mobile_start', + 'unique_id': 'DummyAppliance_CoffeeSystem-state_mobile_start', + 'unit_of_measurement': None, + }) +# --- +# name: test_coffee_system_binary_sensor_states[platforms0-coffee_system.json][binary_sensor.coffee_system_mobile_start-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'Coffee system Mobile start', + }), + 'context': , + 'entity_id': 'binary_sensor.coffee_system_mobile_start', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_coffee_system_binary_sensor_states[platforms0-coffee_system.json][binary_sensor.coffee_system_notification_active-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.coffee_system_notification_active', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Notification active', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Notification active', + 'platform': 'miele', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'notification_active', + 'unique_id': 'DummyAppliance_CoffeeSystem-state_signal_info', + 'unit_of_measurement': None, + }) +# --- +# name: test_coffee_system_binary_sensor_states[platforms0-coffee_system.json][binary_sensor.coffee_system_notification_active-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'problem', + : 'Coffee system Notification active', + }), + 'context': , + 'entity_id': 'binary_sensor.coffee_system_notification_active', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_coffee_system_binary_sensor_states[platforms0-coffee_system.json][binary_sensor.coffee_system_problem-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.coffee_system_problem', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Problem', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Problem', + 'platform': 'miele', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'DummyAppliance_CoffeeSystem-state_signal_failure', + 'unit_of_measurement': None, + }) +# --- +# name: test_coffee_system_binary_sensor_states[platforms0-coffee_system.json][binary_sensor.coffee_system_problem-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'problem', + : 'Coffee system Problem', + }), + 'context': , + 'entity_id': 'binary_sensor.coffee_system_problem', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_coffee_system_binary_sensor_states[platforms0-coffee_system.json][binary_sensor.coffee_system_remote_control-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.coffee_system_remote_control', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Remote control', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Remote control', + 'platform': 'miele', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'remote_control', + 'unique_id': 'DummyAppliance_CoffeeSystem-state_full_remote_control', + 'unit_of_measurement': None, + }) +# --- +# name: test_coffee_system_binary_sensor_states[platforms0-coffee_system.json][binary_sensor.coffee_system_remote_control-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'Coffee system Remote control', + }), + 'context': , + 'entity_id': 'binary_sensor.coffee_system_remote_control', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_coffee_system_binary_sensor_states[platforms0-coffee_system.json][binary_sensor.coffee_system_smart_grid-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.coffee_system_smart_grid', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Smart grid', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Smart grid', + 'platform': 'miele', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'smart_grid', + 'unique_id': 'DummyAppliance_CoffeeSystem-state_smart_grid', + 'unit_of_measurement': None, + }) +# --- +# name: test_coffee_system_binary_sensor_states[platforms0-coffee_system.json][binary_sensor.coffee_system_smart_grid-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'Coffee system Smart grid', + }), + 'context': , + 'entity_id': 'binary_sensor.coffee_system_smart_grid', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- diff --git a/tests/components/miele/test_binary_sensor.py b/tests/components/miele/test_binary_sensor.py index 02cdd7eafe13..e9de038bfd5b 100644 --- a/tests/components/miele/test_binary_sensor.py +++ b/tests/components/miele/test_binary_sensor.py @@ -39,3 +39,18 @@ async def test_binary_sensor_states_api_push( """Test binary sensor state when the API pushes data via SSE.""" await snapshot_platform(hass, entity_registry, snapshot, setup_platform.entry_id) + + +@pytest.mark.parametrize("load_device_file", ["coffee_system.json"]) +@pytest.mark.parametrize("platforms", [(BINARY_SENSOR_DOMAIN,)]) +@pytest.mark.usefixtures("entity_registry_enabled_by_default") +async def test_coffee_system_binary_sensor_states( + hass: HomeAssistant, + mock_miele_client: MagicMock, + snapshot: SnapshotAssertion, + entity_registry: er.EntityRegistry, + setup_platform: MockConfigEntry, +) -> None: + """Test coffee system binary sensor state.""" + + await snapshot_platform(hass, entity_registry, snapshot, setup_platform.entry_id)