Replace dict with DeviceInfo (#49950)

* Replace dict with DeviceInfo

* Clean up

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Milan Meulemans 2021-05-02 00:37:19 +02:00 committed by GitHub
parent ddd7e79ee9
commit 29d72714f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 159 additions and 138 deletions

View file

@ -3,7 +3,6 @@ from __future__ import annotations
from datetime import timedelta
import logging
from typing import Any
from sonarr import Sonarr, SonarrAccessRestricted, SonarrError
@ -19,7 +18,7 @@ from homeassistant.const import (
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity import DeviceInfo, Entity
from .const import (
ATTR_IDENTIFIERS,
@ -139,7 +138,7 @@ class SonarrEntity(Entity):
return self._enabled_default
@property
def device_info(self) -> dict[str, Any]:
def device_info(self) -> DeviceInfo | None:
"""Return device information about the application."""
if self._device_id is None:
return None