Allow passing dictionaries to async_register_entity_service (#26370)
This commit is contained in:
1 parent
df9703d814
commit
0cffd61481
3 files changed
+12
-15
No files matched your search
@@ -15,6 +15,7 @@ from homeassistant.const import (
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers import config_per_platform, discovery
|
||||
from homeassistant.helpers.config_validation import ENTITY_SERVICE_SCHEMA
|
||||
from homeassistant.helpers.service import async_extract_entity_ids
|
||||
from homeassistant.loader import bind_hass, async_get_integration
|
||||
from homeassistant.util import slugify
|
||||
@@ -202,6 +203,8 @@ class EntityComponent:
|
||||
@callback
|
||||
def async_register_entity_service(self, name, schema, func, required_features=None):
|
||||
"""Register an entity service."""
|
||||
if isinstance(schema, dict):
|
||||
schema = ENTITY_SERVICE_SCHEMA.extend(schema)
|
||||
|
||||
async def handle_service(call):
|
||||
"""Handle the service."""
|
||||
|
||||
Reference in new issue
Block a user