Skip to content

Commit 8d6b7bf

Browse files
authored
Fix event affecting multiple probes (home-assistant#150954)
1 parent cf8e7cf commit 8d6b7bf

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

homeassistant/components/togrill/event.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,8 @@ def _handle_event(self, packet: Packet) -> None:
5656
message = PacketA5Notify.Message(packet.message)
5757
except ValueError:
5858
return
59+
60+
if packet.probe != self._probe_number:
61+
return
62+
5963
self._trigger_event(slugify(message.name))

tests/components/togrill/snapshots/test_event.ambr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
# name: test_events[0][event.pro_05_probe_2-state]
104104
StateSnapshot({
105105
'attributes': ReadOnlyDict({
106-
'event_type': 'probe_acknowledge',
106+
'event_type': None,
107107
'event_types': list([
108108
'probe_acknowledge',
109109
'probe_alarm',
@@ -116,7 +116,7 @@
116116
'last_changed': <ANY>,
117117
'last_reported': <ANY>,
118118
'last_updated': <ANY>,
119-
'state': '2023-10-21T00:00:00.000+00:00',
119+
'state': 'unknown',
120120
})
121121
# ---
122122
# name: test_events[5][event.pro_05_probe_1-entry]
@@ -223,7 +223,7 @@
223223
# name: test_events[5][event.pro_05_probe_2-state]
224224
StateSnapshot({
225225
'attributes': ReadOnlyDict({
226-
'event_type': 'probe_alarm',
226+
'event_type': None,
227227
'event_types': list([
228228
'probe_acknowledge',
229229
'probe_alarm',
@@ -236,7 +236,7 @@
236236
'last_changed': <ANY>,
237237
'last_reported': <ANY>,
238238
'last_updated': <ANY>,
239-
'state': '2023-10-21T00:00:00.000+00:00',
239+
'state': 'unknown',
240240
})
241241
# ---
242242
# name: test_events[6][event.pro_05_probe_1-entry]
@@ -343,7 +343,7 @@
343343
# name: test_events[6][event.pro_05_probe_2-state]
344344
StateSnapshot({
345345
'attributes': ReadOnlyDict({
346-
'event_type': 'probe_disconnected',
346+
'event_type': None,
347347
'event_types': list([
348348
'probe_acknowledge',
349349
'probe_alarm',
@@ -356,7 +356,7 @@
356356
'last_changed': <ANY>,
357357
'last_reported': <ANY>,
358358
'last_updated': <ANY>,
359-
'state': '2023-10-21T00:00:00.000+00:00',
359+
'state': 'unknown',
360360
})
361361
# ---
362362
# name: test_setup[no_data][event.pro_05_probe_1-entry]

0 commit comments

Comments
 (0)