Improve deprecation warnings (#20391)

This commit is contained in:
Anders Melchiorsen 2019-01-24 22:37:30 +01:00 committed by Paulus Schoutsen
parent 3b1534c126
commit 70c5807976
2 changed files with 9 additions and 5 deletions

View file

@ -169,7 +169,8 @@ class EntityComponent:
self.logger.warning(
'Not passing an entity ID to a service to target all '
'entities is deprecated. Update your call to %s.%s to be '
'instead: entity_id: "*"', service.domain, service.service)
'instead: entity_id: %s', service.domain, service.service,
ENTITY_MATCH_ALL)
return [entity for entity in self.entities if entity.available]
@ -182,8 +183,9 @@ class EntityComponent:
"""Register an entity service."""
async def handle_service(call):
"""Handle the service."""
service_name = "{}.{}".format(self.domain, name)
await self.hass.helpers.service.entity_service_call(
self._platforms.values(), func, call
self._platforms.values(), func, call, service_name
)
self.hass.services.async_register(