Use DeviceInfo in smartthings (#58523)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet
2021-10-27 13:17:47 +02:00
committed by GitHub
parent 80bbfde07e
commit 6db7f73032

View File

@@ -1,5 +1,6 @@
"""Support for interacting with Smappee Comport Plugs, Switches and Output Modules.""" """Support for interacting with Smappee Comport Plugs, Switches and Output Modules."""
from homeassistant.components.switch import SwitchEntity from homeassistant.components.switch import SwitchEntity
from homeassistant.helpers.entity import DeviceInfo
from .const import DOMAIN from .const import DOMAIN
@@ -148,15 +149,15 @@ class SmappeeActuator(SwitchEntity):
) )
@property @property
def device_info(self): def device_info(self) -> DeviceInfo:
"""Return the device info for this switch.""" """Return the device info for this switch."""
return { return DeviceInfo(
"identifiers": {(DOMAIN, self._service_location.device_serial_number)}, identifiers={(DOMAIN, self._service_location.device_serial_number)},
"name": self._service_location.service_location_name, manufacturer="Smappee",
"manufacturer": "Smappee", model=self._service_location.device_model,
"model": self._service_location.device_model, name=self._service_location.service_location_name,
"sw_version": self._service_location.firmware_version, sw_version=self._service_location.firmware_version,
} )
async def async_update(self): async def async_update(self):
"""Get the latest data from Smappee and update the state.""" """Get the latest data from Smappee and update the state."""