Simplify if-statement, (small #460 fix) (#526)

This commit is contained in:
Bas Nijholt 2023-04-03 11:32:38 -07:00 committed by GitHub
commit 26974c8fd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1067,7 +1067,7 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
return
# See #80. Doesn't check if transitions differ but it does the job.
last_service_data = self.turn_on_off_listener.last_service_data
if light in last_service_data and last_service_data[light] == service_data:
if last_service_data.get(light) == service_data:
_LOGGER.debug(
"%s: Cancelling adapt to light %s, there's no new values to set (context.id='%s')",
self._name,