From 5a00fb411a941dd6209fa9a35f3beaa653ce4b11 Mon Sep 17 00:00:00 2001 From: Piotr Machowski Date: Sun, 11 Oct 2020 22:12:22 +0200 Subject: [PATCH] Adjust script constructor changes --- custom_components/saver/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/saver/__init__.py b/custom_components/saver/__init__.py index 1d765af..dde0e98 100644 --- a/custom_components/saver/__init__.py +++ b/custom_components/saver/__init__.py @@ -3,7 +3,7 @@ from homeassistant.core import Context from homeassistant.helpers.restore_state import RestoreEntity -from homeassistant.helpers.script import Script +from homeassistant.helpers.script import Script, SCRIPT_MODE_PARALLEL from homeassistant.helpers.entity_component import EntityComponent from .const import * @@ -98,7 +98,7 @@ def delete_variable(self, variable): self.schedule_update_ha_state() def execute(self, script): - script = Script(self.hass, script) + script = Script(self.hass, script, self.name, DOMAIN, script_mode=SCRIPT_MODE_PARALLEL) variables = {} variables.update(self._variables_db) for entity_id in self._entities_db: @@ -113,7 +113,7 @@ def restore(self, entity_id, restore_script, delete): variables = SaverEntity.convert_to_variables(old) if delete: self._entities_db.pop(entity_id) - script = Script(self.hass, restore_script) + script = Script(self.hass, restore_script, self.name, DOMAIN, script_mode=SCRIPT_MODE_PARALLEL) script.run(variables=variables, context=Context()) self.schedule_update_ha_state()