Skip to content

Commit

Permalink
Add context to service call #27
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Dec 7, 2024
1 parent 058d56b commit d6e9ad1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/python_script/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def handler(call: ServiceCall) -> ServiceResponse:
else:
_LOGGER.debug("Load code from cache")

return execute_script(hass, call.data, _LOGGER, code)
return execute_script(hass, call.data, call.context, _LOGGER, code)

hass.services.async_register(
DOMAIN,
Expand All @@ -99,7 +99,7 @@ def handler(call: ServiceCall) -> ServiceResponse:
return True


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

0 comments on commit d6e9ad1

Please sign in to comment.