Use DeviceInfo Class P-R (#58324)
This commit is contained in:
parent
5642350070
commit
7ccfaed736
22 changed files with 174 additions and 183 deletions
|
@ -15,6 +15,7 @@ from homeassistant.components.light import (
|
|||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
import homeassistant.util.color as color_util
|
||||
|
||||
|
@ -94,14 +95,14 @@ class PlumLight(LightEntity):
|
|||
return self._load.name
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
def device_info(self) -> DeviceInfo:
|
||||
"""Return the device info."""
|
||||
return {
|
||||
"name": self.name,
|
||||
"identifiers": {(DOMAIN, self.unique_id)},
|
||||
"model": "Dimmer",
|
||||
"manufacturer": "Plum",
|
||||
}
|
||||
return DeviceInfo(
|
||||
identifiers={(DOMAIN, self.unique_id)},
|
||||
manufacturer="Plum",
|
||||
model="Dimmer",
|
||||
name=self.name,
|
||||
)
|
||||
|
||||
@property
|
||||
def brightness(self) -> int:
|
||||
|
@ -185,14 +186,14 @@ class GlowRing(LightEntity):
|
|||
return self._name
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
def device_info(self) -> DeviceInfo:
|
||||
"""Return the device info."""
|
||||
return {
|
||||
"name": self.name,
|
||||
"identifiers": {(DOMAIN, self.unique_id)},
|
||||
"model": "Glow Ring",
|
||||
"manufacturer": "Plum",
|
||||
}
|
||||
return DeviceInfo(
|
||||
identifiers={(DOMAIN, self.unique_id)},
|
||||
manufacturer="Plum",
|
||||
model="Glow Ring",
|
||||
name=self.name,
|
||||
)
|
||||
|
||||
@property
|
||||
def brightness(self) -> int:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue