From af74e36d16358741ff6cc14658a18ba2447f2c99 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 13 Oct 2020 15:26:14 -0500 Subject: [PATCH] Update html5 to use async_add_executor_job (#41788) --- homeassistant/components/html5/notify.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/html5/notify.py b/homeassistant/components/html5/notify.py index 6970ebbedb4..c07cddb7a9c 100644 --- a/homeassistant/components/html5/notify.py +++ b/homeassistant/components/html5/notify.py @@ -242,7 +242,9 @@ class HTML5PushRegistrationView(HomeAssistantView): try: hass = request.app["hass"] - await hass.async_add_job(save_json, self.json_path, self.registrations) + await hass.async_add_executor_job( + save_json, self.json_path, self.registrations + ) return self.json_message("Push notification subscriber registered.") except HomeAssistantError: if previous_registration is not None: @@ -288,7 +290,9 @@ class HTML5PushRegistrationView(HomeAssistantView): try: hass = request.app["hass"] - await hass.async_add_job(save_json, self.json_path, self.registrations) + await hass.async_add_executor_job( + save_json, self.json_path, self.registrations + ) except HomeAssistantError: self.registrations[found] = reg return self.json_message(