Remove attr usage in event helper (#115554)

pull/115564/head
J. Nick Koston 2024-04-13 19:46:23 -05:00 committed by GitHub
parent dad03e7283
commit 8da7de1fea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 9 deletions

View File

@ -13,8 +13,6 @@ from random import randint
import time
from typing import TYPE_CHECKING, Any, Concatenate, Generic, ParamSpec, TypeVar
import attr
from homeassistant.const import (
EVENT_CORE_CONFIG_UPDATE,
EVENT_STATE_CHANGED,
@ -1626,16 +1624,16 @@ def async_track_time_interval(
track_time_interval = threaded_listener_factory(async_track_time_interval)
@attr.s
@dataclass(slots=True)
class SunListener:
"""Helper class to help listen to sun events."""
hass: HomeAssistant = attr.ib()
job: HassJob[[], Coroutine[Any, Any, None] | None] = attr.ib()
event: str = attr.ib()
offset: timedelta | None = attr.ib()
_unsub_sun: CALLBACK_TYPE | None = attr.ib(default=None)
_unsub_config: CALLBACK_TYPE | None = attr.ib(default=None)
hass: HomeAssistant
job: HassJob[[], Coroutine[Any, Any, None] | None]
event: str
offset: timedelta | None
_unsub_sun: CALLBACK_TYPE | None = None
_unsub_config: CALLBACK_TYPE | None = None
@callback
def async_attach(self) -> None: