Fix implicit-return in ecobee (#122832)

pull/122811/head
epenet 2024-07-30 15:33:57 +02:00 committed by GitHub
parent 2135691b90
commit c8372a3aa5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -46,7 +46,7 @@ class EcobeeBinarySensor(BinarySensorEntity):
self.index = sensor_index
@property
def unique_id(self):
def unique_id(self) -> str | None:
"""Return a unique identifier for this sensor."""
for sensor in self.data.ecobee.get_remote_sensors(self.index):
if sensor["name"] == self.sensor_name:
@ -54,6 +54,7 @@ class EcobeeBinarySensor(BinarySensorEntity):
return f"{sensor['code']}-{self.device_class}"
thermostat = self.data.ecobee.get_thermostat(self.index)
return f"{thermostat['identifier']}-{sensor['id']}-{self.device_class}"
return None
@property
def device_info(self) -> DeviceInfo | None:

View File

@ -112,7 +112,7 @@ class EcobeeSensor(SensorEntity):
self._state = None
@property
def unique_id(self):
def unique_id(self) -> str | None:
"""Return a unique identifier for this sensor."""
for sensor in self.data.ecobee.get_remote_sensors(self.index):
if sensor["name"] == self.sensor_name:
@ -120,6 +120,7 @@ class EcobeeSensor(SensorEntity):
return f"{sensor['code']}-{self.device_class}"
thermostat = self.data.ecobee.get_thermostat(self.index)
return f"{thermostat['identifier']}-{sensor['id']}-{self.device_class}"
return None
@property
def device_info(self) -> DeviceInfo | None: