Replace dict with DeviceInfo (#49950)
* Replace dict with DeviceInfo * Clean up Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
ddd7e79ee9
commit
29d72714f3
70 changed files with 159 additions and 138 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue