From 1ee83501a15ffc1644ad7b4350088366ad35e84c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Wed, 26 Jun 2019 23:56:24 +0200 Subject: [PATCH] Communication other way works too --- custom_components/browser_mod/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/browser_mod/__init__.py b/custom_components/browser_mod/__init__.py index 4c56a4c..b6619ca 100644 --- a/custom_components/browser_mod/__init__.py +++ b/custom_components/browser_mod/__init__.py @@ -1,7 +1,7 @@ import logging import voluptuous as vol -from homeassistant.components.websocket_api import websocket_command, result_message, async_register_command +from homeassistant.components.websocket_api import websocket_command, result_message, event_message, async_register_command from .mod_view import setup_view @@ -31,3 +31,5 @@ def handle_connect(hass, connection, msg): _LOGGER.error(f"Got connection {msg}") connection.send_message(result_message(msg['id'])) + + connection.send_message(event_message(msg['id'], {"data": "something"}))