From f539dd775cdb075f5c46dcbdb5f1fe2de2665f72 Mon Sep 17 00:00:00 2001 From: Will Adler Date: Sat, 10 Aug 2024 00:22:49 -0400 Subject: [PATCH] import helper directly --- custom_components/leafspy/__init__.py | 5 ++--- custom_components/leafspy/manifest.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) mode change 100644 => 100755 custom_components/leafspy/manifest.json diff --git a/custom_components/leafspy/__init__.py b/custom_components/leafspy/__init__.py index f753d4a..c522d89 100755 --- a/custom_components/leafspy/__init__.py +++ b/custom_components/leafspy/__init__.py @@ -9,7 +9,7 @@ from homeassistant.components.http.view import HomeAssistantView from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.core import callback, HomeAssistant -from homeassistant.helpers.dispatcher import async_dispatcher_connect +from homeassistant.helpers.dispatcher import async_dispatcher_connect, async_dispatcher_send from .config_flow import CONF_SECRET, DOMAIN, URL_LEAFSPY_PATH from .device_tracker import async_handle_message @@ -105,8 +105,7 @@ async def get(self, request): if not hmac.compare_digest(message['pass'], context.secret): raise Exception("Invalid password") - hass.helpers.dispatcher.async_dispatcher_send( - DOMAIN, hass, context, message) + async_dispatcher_send(DOMAIN, hass, context, message) return Response(status=200, text='"status":"0"') except Exception: # pylint: disable=broad-except diff --git a/custom_components/leafspy/manifest.json b/custom_components/leafspy/manifest.json old mode 100644 new mode 100755 index 4dfff4c..4f47e6a --- a/custom_components/leafspy/manifest.json +++ b/custom_components/leafspy/manifest.json @@ -8,5 +8,5 @@ "iot_class": "local_push", "issue_tracker": "https://github.com/jesserockz/ha-leafspy/issues", "requirements": [], - "version": "0.2.2" + "version": "0.2.3" }