diff --git a/custom_components/sws12500/__init__.py b/custom_components/sws12500/__init__.py index aa030c6..3e5b29d 100644 --- a/custom_components/sws12500/__init__.py +++ b/custom_components/sws12500/__init__.py @@ -163,7 +163,7 @@ def register_path( if debug: _LOGGER.debug("Default route: %s", default_route) - wslink_route = hass.http.app.router.add_post( + wslink_route = hass.http.app.router.add_get( WSLINK_URL, coordinator.recieved_data if _wslink else unregistred, name="weather_wslink_url", @@ -171,6 +171,14 @@ def register_path( if debug: _LOGGER.debug("WSLink route: %s", wslink_route) + wslink_post_route = hass.http.app.router.add_post( + WSLINK_URL, + coordinator.recieved_data if _wslink else unregistred, + name="weather_wslink_post_route_url", + ) + if debug: + _LOGGER.debug("WSLink route: %s", wslink_post_route) + routes.add_route( DEFAULT_URL, default_route, @@ -181,6 +189,10 @@ def register_path( WSLINK_URL, wslink_route, coordinator.recieved_data, _wslink ) + routes.add_route( + WSLINK_URL, wslink_post_route, coordinator.recieved_data, _wslink + ) + hass_data["routes"] = routes except RuntimeError as Ex: # pylint: disable=(broad-except)