Fix implicit-return in ecobee (#122832)
parent
2135691b90
commit
c8372a3aa5
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue