mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Use dataclass for abode system class (#101138)
This commit is contained in:
parent
9444a474ec
commit
42eb849cae
@ -1,6 +1,7 @@
|
|||||||
"""Support for the Abode Security System."""
|
"""Support for the Abode Security System."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from dataclasses import dataclass, field
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from jaraco.abode.automation import Automation as AbodeAuto
|
from jaraco.abode.automation import Automation as AbodeAuto
|
||||||
@ -25,7 +26,7 @@ from homeassistant.const import (
|
|||||||
EVENT_HOMEASSISTANT_STOP,
|
EVENT_HOMEASSISTANT_STOP,
|
||||||
Platform,
|
Platform,
|
||||||
)
|
)
|
||||||
from homeassistant.core import Event, HomeAssistant, ServiceCall
|
from homeassistant.core import CALLBACK_TYPE, Event, HomeAssistant, ServiceCall
|
||||||
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
||||||
from homeassistant.helpers import config_validation as cv, entity
|
from homeassistant.helpers import config_validation as cv, entity
|
||||||
from homeassistant.helpers.device_registry import DeviceInfo
|
from homeassistant.helpers.device_registry import DeviceInfo
|
||||||
@ -71,15 +72,14 @@ PLATFORMS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
class AbodeSystem:
|
class AbodeSystem:
|
||||||
"""Abode System class."""
|
"""Abode System class."""
|
||||||
|
|
||||||
def __init__(self, abode: Abode, polling: bool) -> None:
|
abode: Abode
|
||||||
"""Initialize the system."""
|
polling: bool
|
||||||
self.abode = abode
|
entity_ids: set[str | None] = field(default_factory=set)
|
||||||
self.polling = polling
|
logout_listener: CALLBACK_TYPE | None = None
|
||||||
self.entity_ids: set[str | None] = set()
|
|
||||||
self.logout_listener = None
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user