Added support for GET and POST endpoints.

ecowitt_support
SchiZzA 2026-02-26 17:58:12 +01:00
parent 1bbeab1ffe
commit 9255820a13
No known key found for this signature in database
1 changed files with 6 additions and 1 deletions

View File

@ -27,6 +27,7 @@ period where no entities are subscribed, causing stale states until another full
""" """
from asyncio import timeout from asyncio import timeout
from inspect import isawaitable
import logging import logging
from typing import Any, cast from typing import Any, cast
@ -198,7 +199,11 @@ class WeatherDataUpdateCoordinator(DataUpdateCoordinator):
# Incoming station payload is delivered as query params. # Incoming station payload is delivered as query params.
# We copy it to a plain dict so it can be passed around safely. # We copy it to a plain dict so it can be passed around safely.
data: dict[str, Any] = dict(webdata.query) get_data = webdata.query
post_data = await webdata.post()
# normalize incoming data to dict[str, Any]
data: dict[str, Any] = {**dict(get_data), **dict(post_data)}
# Validate auth keys (different parameter names depending on endpoint mode). # Validate auth keys (different parameter names depending on endpoint mode).
if not _wslink and ("ID" not in data or "PASSWORD" not in data): if not _wslink and ("ID" not in data or "PASSWORD" not in data):