mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Improve cast
typing (#86536)
This commit is contained in:
parent
d684aa4225
commit
b4ddff751a
@ -5,6 +5,7 @@ import asyncio
|
|||||||
import configparser
|
import configparser
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
import logging
|
import logging
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
@ -19,6 +20,10 @@ from homeassistant.helpers import aiohttp_client
|
|||||||
|
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from homeassistant.components import zeroconf
|
||||||
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
_PLS_SECTION_PLAYLIST = "playlist"
|
_PLS_SECTION_PLAYLIST = "playlist"
|
||||||
@ -124,15 +129,15 @@ class ChromecastInfo:
|
|||||||
class ChromeCastZeroconf:
|
class ChromeCastZeroconf:
|
||||||
"""Class to hold a zeroconf instance."""
|
"""Class to hold a zeroconf instance."""
|
||||||
|
|
||||||
__zconf = None
|
__zconf: zeroconf.HaZeroconf | None = None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def set_zeroconf(cls, zconf):
|
def set_zeroconf(cls, zconf: zeroconf.HaZeroconf) -> None:
|
||||||
"""Set zeroconf."""
|
"""Set zeroconf."""
|
||||||
cls.__zconf = zconf
|
cls.__zconf = zconf
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_zeroconf(cls):
|
def get_zeroconf(cls) -> zeroconf.HaZeroconf | None:
|
||||||
"""Get zeroconf."""
|
"""Get zeroconf."""
|
||||||
return cls.__zconf
|
return cls.__zconf
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user