Skip to content

Commit 673ccf4

Browse files
authored
Merge pull request #330 from danobot/develop
Develop
2 parents d083fe3 + 180d230 commit 673ccf4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

custom_components/entity_controller/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
Project Page: https://danielbkr.net/projects/entity-controller/
2323
Documentation: https://github.com/danobot/entity-controller
2424
"""
25+
import asyncio
2526
import hashlib
2627
import logging
2728
import re
@@ -1582,8 +1583,9 @@ def call_service(self, entity, service, **service_data):
15821583
params = service_data
15831584

15841585
params["entity_id"] = entity
1585-
self.hass.async_create_task(
1586-
self.hass.services.async_call(domain, service, service_data, context=self.context)
1586+
asyncio.run_coroutine_threadsafe(
1587+
self.hass.services.async_call(domain, service, service_data, context=self.context),
1588+
self.hass.loop
15871589
)
15881590
self.update(service_data=service_data)
15891591

0 commit comments

Comments
 (0)