Use assignment expressions 34 (#58823)

This commit is contained in:
Marc Mueller 2021-10-31 19:01:16 +01:00 committed by GitHub
parent e0c0d00833
commit 4c68662612
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 36 additions and 75 deletions

View file

@ -210,8 +210,7 @@ class NestTempSensor(NestSensorDevice, SensorEntity):
else:
self._unit = TEMP_FAHRENHEIT
temp = getattr(self.device, self.variable)
if temp is None:
if (temp := getattr(self.device, self.variable)) is None:
self._state = None
if isinstance(temp, tuple):