mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Enable RUF023 (#135830)
This commit is contained in:
committed by
GitHub
parent
23e04ced9c
commit
ef8b8fbbaa
@ -332,7 +332,7 @@ class HassJob[**_P, _R_co]:
|
||||
we run the job.
|
||||
"""
|
||||
|
||||
__slots__ = ("target", "name", "_cancel_on_shutdown", "_cache")
|
||||
__slots__ = ("_cache", "_cancel_on_shutdown", "name", "target")
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -1246,7 +1246,7 @@ class HomeAssistant:
|
||||
class Context:
|
||||
"""The context that triggered something."""
|
||||
|
||||
__slots__ = ("id", "user_id", "parent_id", "origin_event", "_cache")
|
||||
__slots__ = ("_cache", "id", "origin_event", "parent_id", "user_id")
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -1321,12 +1321,12 @@ class Event(Generic[_DataT]):
|
||||
"""Representation of an event within the bus."""
|
||||
|
||||
__slots__ = (
|
||||
"event_type",
|
||||
"_cache",
|
||||
"context",
|
||||
"data",
|
||||
"event_type",
|
||||
"origin",
|
||||
"time_fired_timestamp",
|
||||
"context",
|
||||
"_cache",
|
||||
)
|
||||
|
||||
def __init__(
|
||||
@ -1767,18 +1767,18 @@ class State:
|
||||
"""
|
||||
|
||||
__slots__ = (
|
||||
"entity_id",
|
||||
"state",
|
||||
"_cache",
|
||||
"attributes",
|
||||
"context",
|
||||
"domain",
|
||||
"entity_id",
|
||||
"last_changed",
|
||||
"last_reported",
|
||||
"last_updated",
|
||||
"context",
|
||||
"state_info",
|
||||
"domain",
|
||||
"object_id",
|
||||
"last_updated_timestamp",
|
||||
"_cache",
|
||||
"object_id",
|
||||
"state",
|
||||
"state_info",
|
||||
)
|
||||
|
||||
def __init__(
|
||||
@ -2066,7 +2066,7 @@ class States(UserDict[str, State]):
|
||||
class StateMachine:
|
||||
"""Helper class that tracks the state of different entities."""
|
||||
|
||||
__slots__ = ("_states", "_states_data", "_reservations", "_bus", "_loop")
|
||||
__slots__ = ("_bus", "_loop", "_reservations", "_states", "_states_data")
|
||||
|
||||
def __init__(self, bus: EventBus, loop: asyncio.events.AbstractEventLoop) -> None:
|
||||
"""Initialize state machine."""
|
||||
@ -2404,7 +2404,7 @@ class SupportsResponse(enum.StrEnum):
|
||||
class Service:
|
||||
"""Representation of a callable service."""
|
||||
|
||||
__slots__ = ["job", "schema", "domain", "service", "supports_response"]
|
||||
__slots__ = ["domain", "job", "schema", "service", "supports_response"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -2431,7 +2431,7 @@ class Service:
|
||||
class ServiceCall:
|
||||
"""Representation of a call to a service."""
|
||||
|
||||
__slots__ = ("hass", "domain", "service", "data", "context", "return_response")
|
||||
__slots__ = ("context", "data", "domain", "hass", "return_response", "service")
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -2464,7 +2464,7 @@ class ServiceCall:
|
||||
class ServiceRegistry:
|
||||
"""Offer the services over the eventbus."""
|
||||
|
||||
__slots__ = ("_services", "_hass")
|
||||
__slots__ = ("_hass", "_services")
|
||||
|
||||
def __init__(self, hass: HomeAssistant) -> None:
|
||||
"""Initialize a service registry."""
|
||||
|
Reference in New Issue
Block a user