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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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