Skip to content

Commit d1a7e64

Browse files
committed
Remove ConfigEntryServiceOverride dataclass
1 parent 382410c commit d1a7e64

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

homeassistant/core.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
ValuesView,
2020
)
2121
import concurrent.futures
22-
from dataclasses import dataclass, field
22+
from dataclasses import dataclass
2323
import datetime
2424
import enum
2525
import functools
@@ -2412,19 +2412,6 @@ class SupportsResponse(enum.StrEnum):
24122412
"""The service is read-only and the caller must always ask for response data."""
24132413

24142414

2415-
@dataclass(slots=True)
2416-
class ConfigEntryServiceOverride:
2417-
"""Per-ConfigEntry service override that can handle multiple entities.
2418-
2419-
The `entities` set accumulates all entities targeted during a service call,
2420-
allowing the callback to process them in a single invocation instead of
2421-
individual entity calls.
2422-
"""
2423-
2424-
handler: ConfigEntryServiceCallback
2425-
entities: set[Entity] = field(default_factory=set)
2426-
2427-
24282415
class Service:
24292416
"""Representation of a callable service."""
24302417

@@ -2460,7 +2447,7 @@ def __init__(
24602447
self.schema = schema
24612448
self.supports_response = supports_response
24622449
self.description_placeholders = description_placeholders
2463-
self.overrides: dict[ConfigEntry, ConfigEntryServiceOverride] = {}
2450+
self.overrides: dict[ConfigEntry, ConfigEntryServiceCallback] = {}
24642451

24652452
@callback
24662453
def async_register_config_entry_override(
@@ -2472,12 +2459,9 @@ def async_register_config_entry_override(
24722459
24732460
The override handler will receive a ConfigEntry, a set of entities
24742461
and a ServiceCall object.
2475-
Entities will be accumulated for multi-entity execution.
2462+
The handler is responsible for consuming the entities it processes.
24762463
"""
2477-
override = self.overrides.setdefault(
2478-
config_entry, ConfigEntryServiceOverride(handler)
2479-
)
2480-
override.handler = handler
2464+
self.overrides.setdefault(config_entry, handler)
24812465

24822466

24832467
class ServiceCall:

0 commit comments

Comments
 (0)