Use DeviceInfo Class E (#58230)
This commit is contained in:
parent
137d41d8b4
commit
12c067970a
13 changed files with 111 additions and 99 deletions
|
@ -1,8 +1,11 @@
|
|||
"""Support for Ecobee binary sensors."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_OCCUPANCY,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
|
||||
from .const import DOMAIN, ECOBEE_MODEL_TO_NAME, MANUFACTURER
|
||||
|
||||
|
@ -49,7 +52,7 @@ class EcobeeBinarySensor(BinarySensorEntity):
|
|||
return f"{thermostat['identifier']}-{sensor['id']}-{self.device_class}"
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
def device_info(self) -> DeviceInfo | None:
|
||||
"""Return device information for this sensor."""
|
||||
identifier = None
|
||||
model = None
|
||||
|
@ -72,12 +75,12 @@ class EcobeeBinarySensor(BinarySensorEntity):
|
|||
break
|
||||
|
||||
if identifier is not None:
|
||||
return {
|
||||
"identifiers": {(DOMAIN, identifier)},
|
||||
"name": self.sensor_name,
|
||||
"manufacturer": MANUFACTURER,
|
||||
"model": model,
|
||||
}
|
||||
return DeviceInfo(
|
||||
identifiers={(DOMAIN, identifier)},
|
||||
manufacturer=MANUFACTURER,
|
||||
model=model,
|
||||
name=self.sensor_name,
|
||||
)
|
||||
return None
|
||||
|
||||
@property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue