Skip to content

Commit d6e9ad1

Browse files
committed
Add context to service call #27
1 parent 058d56b commit d6e9ad1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

custom_components/python_script/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def handler(call: ServiceCall) -> ServiceResponse:
8686
else:
8787
_LOGGER.debug("Load code from cache")
8888

89-
return execute_script(hass, call.data, _LOGGER, code)
89+
return execute_script(hass, call.data, call.context, _LOGGER, code)
9090

9191
hass.services.async_register(
9292
DOMAIN,
@@ -99,7 +99,7 @@ def handler(call: ServiceCall) -> ServiceResponse:
9999
return True
100100

101101

102-
def execute_script(hass: HomeAssistant, data: dict, logger, code) -> ServiceResponse:
102+
def execute_script(hass, data, context, logger, code) -> ServiceResponse:
103103
try:
104104
_LOGGER.debug("Run python script")
105105
vars = {**globals(), **locals()}

0 commit comments

Comments
 (0)