Use assignment expressions 35 (#58824)

This commit is contained in:
Marc Mueller 2021-10-31 18:32:17 +01:00 committed by GitHub
parent ab7d8db481
commit 3f1b4906bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 26 additions and 65 deletions

View file

@ -112,9 +112,7 @@ class PwBinarySensor(SmileBinarySensor, BinarySensorEntity):
@callback
def _async_process_data(self):
"""Update the entity."""
data = self._api.get_device_data(self._dev_id)
if not data:
if not (data := self._api.get_device_data(self._dev_id)):
_LOGGER.error("Received no data for device %s", self._binary_sensor)
self.async_write_ha_state()
return