Use homeassistant.const instead of integration const for device_info ATTR_ (#53703)
This commit is contained in:
parent
4f96f05a75
commit
8ab3d9cc12
20 changed files with 66 additions and 90 deletions
|
@ -17,7 +17,14 @@ from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
|
|||
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
||||
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import ATTR_MODEL, ATTR_NAME, ATTR_SW_VERSION, CONF_HOST
|
||||
from homeassistant.const import (
|
||||
ATTR_IDENTIFIERS,
|
||||
ATTR_MANUFACTURER,
|
||||
ATTR_MODEL,
|
||||
ATTR_NAME,
|
||||
ATTR_SW_VERSION,
|
||||
CONF_HOST,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
|
@ -27,7 +34,7 @@ from homeassistant.helpers.update_coordinator import (
|
|||
UpdateFailed,
|
||||
)
|
||||
|
||||
from .const import ATTR_IDENTIFIERS, ATTR_MANUFACTURER, DOMAIN
|
||||
from .const import DOMAIN
|
||||
|
||||
SCAN_INTERVAL = timedelta(seconds=5)
|
||||
PLATFORMS = [
|
||||
|
@ -153,7 +160,7 @@ class ModernFormsDeviceEntity(CoordinatorEntity[ModernFormsDataUpdateCoordinator
|
|||
def device_info(self) -> DeviceInfo:
|
||||
"""Return device information about this Modern Forms device."""
|
||||
return {
|
||||
ATTR_IDENTIFIERS: {(DOMAIN, self.coordinator.data.info.mac_address)}, # type: ignore
|
||||
ATTR_IDENTIFIERS: {(DOMAIN, self.coordinator.data.info.mac_address)},
|
||||
ATTR_NAME: self.coordinator.data.info.device_name,
|
||||
ATTR_MANUFACTURER: "Modern Forms",
|
||||
ATTR_MODEL: self.coordinator.data.info.fan_type,
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
|
||||
DOMAIN = "modern_forms"
|
||||
|
||||
ATTR_IDENTIFIERS = "identifiers"
|
||||
ATTR_MANUFACTURER = "manufacturer"
|
||||
|
||||
OPT_ON = "on"
|
||||
OPT_SPEED = "speed"
|
||||
OPT_BRIGHTNESS = "brightness"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue