Use DeviceInfo in somfy-mylink (#58573)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-10-28 09:39:12 +02:00 committed by GitHub
parent f7797328e6
commit 3e4d388491
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,6 +8,7 @@ from homeassistant.components.cover import (
CoverEntity,
)
from homeassistant.const import STATE_CLOSED, STATE_OPEN
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.restore_state import RestoreEntity
from .const import (
@ -115,13 +116,13 @@ class SomfyShade(RestoreEntity, CoverEntity):
return self._closed
@property
def device_info(self):
def device_info(self) -> DeviceInfo:
"""Return the device_info of the device."""
return {
"identifiers": {(DOMAIN, self._target_id)},
"name": self._name,
"manufacturer": MANUFACTURER,
}
return DeviceInfo(
identifiers={(DOMAIN, self._target_id)},
manufacturer=MANUFACTURER,
name=self._name,
)
async def async_close_cover(self, **kwargs):
"""Close the cover."""