Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion homeassistant/components/matter/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def _update_from_device(self) -> None:
platform=Platform.BINARY_SENSOR,
entity_description=MatterBinarySensorEntityDescription(
key="DishwasherAlarmDoorError",
translation_key="dishwasher_alarm_door",
translation_key="alarm_door",
device_class=BinarySensorDeviceClass.PROBLEM,
entity_category=EntityCategory.DIAGNOSTIC,
device_to_ha=lambda x: (
Expand All @@ -407,4 +407,19 @@ def _update_from_device(self) -> None:
required_attributes=(clusters.DishwasherAlarm.Attributes.State,),
allow_multi=True,
),
MatterDiscoverySchema(
platform=Platform.BINARY_SENSOR,
entity_description=MatterBinarySensorEntityDescription(
key="RefrigeratorAlarmDoorOpen",
translation_key="alarm_door",
device_class=BinarySensorDeviceClass.PROBLEM,
entity_category=EntityCategory.DIAGNOSTIC,
device_to_ha=lambda x: (
x == clusters.RefrigeratorAlarm.Bitmaps.AlarmBitmap.kDoorOpen
),
),
entity_class=MatterBinarySensor,
required_attributes=(clusters.RefrigeratorAlarm.Attributes.State,),
allow_multi=True,
),
]
2 changes: 1 addition & 1 deletion homeassistant/components/matter/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"dishwasher_alarm_inflow": {
"name": "Inflow alarm"
},
"dishwasher_alarm_door": {
"alarm_door": {
"name": "Door alarm"
}
},
Expand Down
4 changes: 4 additions & 0 deletions homeassistant/components/togrill/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@ def _handle_event(self, packet: Packet) -> None:
message = PacketA5Notify.Message(packet.message)
except ValueError:
return

if packet.probe != self._probe_number:
return

self._trigger_event(slugify(message.name))
75 changes: 62 additions & 13 deletions tests/components/matter/snapshots/test_binary_sensor.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'dishwasher_alarm_door',
'translation_key': 'alarm_door',
'unique_id': '00000000000004D2-0000000000000036-MatterNodeDevice-1-DishwasherAlarmDoorError-93-2',
'unit_of_measurement': None,
})
Expand Down Expand Up @@ -587,6 +587,55 @@
'state': 'off',
})
# ---
# name: test_binary_sensors[silabs_evse_charging][binary_sensor.evse_charger_supply_state-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': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.evse_charger_supply_state',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
'original_icon': None,
'original_name': 'Charger supply state',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'evse_supply_state',
'unique_id': '00000000000004D2-0000000000000017-MatterNodeDevice-1-EnergyEvseSupplyStateSensor-153-1',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[silabs_evse_charging][binary_sensor.evse_charger_supply_state-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'evse Charger supply state',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.evse_charger_supply_state',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_binary_sensors[silabs_evse_charging][binary_sensor.evse_charging_status-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
Expand Down Expand Up @@ -685,7 +734,7 @@
'state': 'on',
})
# ---
# name: test_binary_sensors[silabs_evse_charging][binary_sensor.evse_charger_supply_state-entry]
# name: test_binary_sensors[silabs_refrigerator][binary_sensor.refrigerator_door_alarm-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
Expand All @@ -697,8 +746,8 @@
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.evse_charger_supply_state',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.refrigerator_door_alarm',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
Expand All @@ -708,30 +757,30 @@
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
'original_device_class': <BinarySensorDeviceClass.PROBLEM: 'problem'>,
'original_icon': None,
'original_name': 'Charger supply state',
'original_name': 'Door alarm',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'evse_supply_state',
'unique_id': '00000000000004D2-0000000000000017-MatterNodeDevice-1-EnergyEvseSupplyStateSensor-153-1',
'translation_key': 'alarm_door',
'unique_id': '00000000000004D2-000000000000003A-MatterNodeDevice-1-RefrigeratorAlarmDoorOpen-87-2',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[silabs_evse_charging][binary_sensor.evse_charger_supply_state-state]
# name: test_binary_sensors[silabs_refrigerator][binary_sensor.refrigerator_door_alarm-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'evse Charger supply state',
'device_class': 'problem',
'friendly_name': 'Refrigerator Door alarm',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.evse_charger_supply_state',
'entity_id': 'binary_sensor.refrigerator_door_alarm',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
'state': 'off',
})
# ---
# name: test_binary_sensors[silabs_water_heater][binary_sensor.water_heater_boost_state-entry]
Expand Down
12 changes: 6 additions & 6 deletions tests/components/togrill/snapshots/test_event.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
# name: test_events[0][event.pro_05_probe_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'event_type': 'probe_acknowledge',
'event_type': None,
'event_types': list([
'probe_acknowledge',
'probe_alarm',
Expand All @@ -116,7 +116,7 @@
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '2023-10-21T00:00:00.000+00:00',
'state': 'unknown',
})
# ---
# name: test_events[5][event.pro_05_probe_1-entry]
Expand Down Expand Up @@ -223,7 +223,7 @@
# name: test_events[5][event.pro_05_probe_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'event_type': 'probe_alarm',
'event_type': None,
'event_types': list([
'probe_acknowledge',
'probe_alarm',
Expand All @@ -236,7 +236,7 @@
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '2023-10-21T00:00:00.000+00:00',
'state': 'unknown',
})
# ---
# name: test_events[6][event.pro_05_probe_1-entry]
Expand Down Expand Up @@ -343,7 +343,7 @@
# name: test_events[6][event.pro_05_probe_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'event_type': 'probe_disconnected',
'event_type': None,
'event_types': list([
'probe_acknowledge',
'probe_alarm',
Expand All @@ -356,7 +356,7 @@
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '2023-10-21T00:00:00.000+00:00',
'state': 'unknown',
})
# ---
# name: test_setup[no_data][event.pro_05_probe_1-entry]
Expand Down
Loading