Use DeviceInfo object d-o (#96280)
This commit is contained in:
parent
2f6826dbe3
commit
a04aaf10a5
8 changed files with 47 additions and 43 deletions
|
@ -14,6 +14,7 @@ from homeassistant.components.climate import (
|
|||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import DOMAIN
|
||||
|
@ -152,10 +153,10 @@ class DemoClimate(ClimateEntity):
|
|||
self._swing_modes = ["auto", "1", "2", "3", "off"]
|
||||
self._target_temperature_high = target_temp_high
|
||||
self._target_temperature_low = target_temp_low
|
||||
self._attr_device_info = {
|
||||
"identifiers": {(DOMAIN, unique_id)},
|
||||
"name": device_name,
|
||||
}
|
||||
self._attr_device_info = DeviceInfo(
|
||||
identifiers={(DOMAIN, unique_id)},
|
||||
name=device_name,
|
||||
)
|
||||
|
||||
@property
|
||||
def unique_id(self) -> str:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue