Skip to content

Commit 1f3185e

Browse files
committed
Combine the is not None checks into a single condition using all()
1 parent a59668f commit 1f3185e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

custom_components/qss/event_handling.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ def put_event_to_queue(
1212
"""Get events with new states and put them in the process queue."""
1313
entity_id = event.data.get(ATTR_ENTITY_ID)
1414
state = event.data.get("new_state")
15-
if (
16-
entity_id is not None
17-
and state is not None
18-
and state.state != STATE_UNKNOWN
19-
and entity_filter(entity_id)
20-
):
15+
if all([
16+
entity_id,
17+
state,
18+
state.state != STATE_UNKNOWN,
19+
entity_filter(entity_id)
20+
]):
2121
queue.put(event)
2222

2323

0 commit comments

Comments
 (0)