Use assignment expressions 24 (#58181)
This commit is contained in:
parent
eab235173b
commit
ea2e94a4e5
21 changed files with 29 additions and 66 deletions
|
@ -95,8 +95,7 @@ class ThresholdSensor(BinarySensorEntity):
|
|||
@callback
|
||||
def async_threshold_sensor_state_listener(event):
|
||||
"""Handle sensor state changes."""
|
||||
new_state = event.data.get("new_state")
|
||||
if new_state is None:
|
||||
if (new_state := event.data.get("new_state")) is None:
|
||||
return
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue