Add unique IDs to automation/scenes (#31150)

* Add unique IDs to automation and scenes

* Fix typo
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2020-01-26 23:01:35 -08:00
1 parent 8fff6462a1
commit 1f0f62de7f
14 files changed
+123 -27

No files matched your search

+6 -2
View File
@@ -28,6 +28,8 @@ SECTIONS = (
"scene",
)
ON_DEMAND = ("zwave",)
ACTION_CREATE_UPDATE = "create_update"
ACTION_DELETE = "delete"
async def async_setup(hass, config):
@@ -152,7 +154,9 @@ class BaseEditConfigView(HomeAssistantView):
await hass.async_add_executor_job(_write, path, current)
if self.post_write_hook is not None:
hass.async_create_task(self.post_write_hook(hass))
hass.async_create_task(
self.post_write_hook(ACTION_CREATE_UPDATE, config_key)
)
return self.json({"result": "ok"})
@@ -170,7 +174,7 @@ class BaseEditConfigView(HomeAssistantView):
await hass.async_add_executor_job(_write, path, current)
if self.post_write_hook is not None:
hass.async_create_task(self.post_write_hook(hass))
hass.async_create_task(self.post_write_hook(ACTION_DELETE, config_key))
return self.json({"result": "ok"})