From ea40f35f605e70e6cd0b58e96142267ffc5b14c6 Mon Sep 17 00:00:00 2001 From: Graeme Dewe Date: Mon, 13 Jan 2025 11:50:31 +0000 Subject: [PATCH] Add headers to attempt to circumvent possible rate limiting --- custom_components/wavespa/manifest.json | 2 +- custom_components/wavespa/number.py | 6 +++--- custom_components/wavespa/wavespa/api.py | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/custom_components/wavespa/manifest.json b/custom_components/wavespa/manifest.json index 7e5e7e5..2a6739a 100644 --- a/custom_components/wavespa/manifest.json +++ b/custom_components/wavespa/manifest.json @@ -9,5 +9,5 @@ "iot_class": "cloud_polling", "issue_tracker": "https://github.com/GraemeDBlue/ha-wavespa/issues", "requirements": [], - "version": "1.2.2" + "version": "1.2.3" } diff --git a/custom_components/wavespa/number.py b/custom_components/wavespa/number.py index c8c90b4..55a0ec8 100644 --- a/custom_components/wavespa/number.py +++ b/custom_components/wavespa/number.py @@ -56,6 +56,6 @@ def native_value(self) -> float | None: return hours return None - async def async_set_native_value(self, value: float) -> None: - """Update the current value.""" - await self.coordinator.api.pool_filter_set_time(self.device_id, int(value)) + # async def async_set_native_value(self, value: float) -> None: + # """Update the current value.""" + # await self.coordinator.api.pool_filter_set_time(self.device_id, int(value)) diff --git a/custom_components/wavespa/wavespa/api.py b/custom_components/wavespa/wavespa/api.py index a9d775e..3f470b2 100644 --- a/custom_components/wavespa/wavespa/api.py +++ b/custom_components/wavespa/wavespa/api.py @@ -25,6 +25,8 @@ _HEADERS = { "Content-type": "application/json; charset=UTF-8", "X-Gizwits-Application-Id": "78a879318939402b9c70819d918ef8ed", + "User-Agent": "okhttp/5.0.0-alpha.3", + "Connection": "Keep-Alive" } _TIMEOUT = 10