Skip to content

Commit

Permalink
Adjust script constructor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrMachowski committed Oct 11, 2020
1 parent 7f679fd commit 5a00fb4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/saver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down Expand Up @@ -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:
Expand All @@ -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()

Expand Down

0 comments on commit 5a00fb4

Please sign in to comment.