From 96094105e0e69140b6bdba36ef17cdfd1b9b0850 Mon Sep 17 00:00:00 2001 From: SchiZzA Date: Thu, 26 Feb 2026 18:09:52 +0100 Subject: [PATCH] Added support for POST and GET methods in WSLink. Some stations sending data in POST method and some in GET method. We now support both variants. --- custom_components/sws12500/__init__.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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)