From 3993b9d4a942c6737d8f0e48996287e593720a0f Mon Sep 17 00:00:00 2001 From: Antoine Reversat Date: Thu, 5 Sep 2024 10:35:45 -0400 Subject: [PATCH] Fix refresh --- src/ayla_iot_unofficial/fujitsu_consts.py | 2 +- src/ayla_iot_unofficial/fujitsu_hvac.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ayla_iot_unofficial/fujitsu_consts.py b/src/ayla_iot_unofficial/fujitsu_consts.py index f158fbf..15f77b3 100644 --- a/src/ayla_iot_unofficial/fujitsu_consts.py +++ b/src/ayla_iot_unofficial/fujitsu_consts.py @@ -4,7 +4,7 @@ FGLAIR_APP_SECRET = "CJIOSP-Vb8MQL_lFiYQ7DKjN0eCFXznKZE" OEM_MODEL = "oem_model" -PROP = "prop" +REFRESH = "refresh" DISPLAY_TEMP = "display_temperature" DEVICE_NAME = "device_name" DEVICE_CAPABILITIES = "device_capabilities" diff --git a/src/ayla_iot_unofficial/fujitsu_hvac.py b/src/ayla_iot_unofficial/fujitsu_hvac.py index 48e7354..c27408d 100644 --- a/src/ayla_iot_unofficial/fujitsu_hvac.py +++ b/src/ayla_iot_unofficial/fujitsu_hvac.py @@ -7,7 +7,7 @@ from .device import Device, PropertyName, PropertyValue, AylaReadOnlyPropertyError from .fujitsu_consts import ( OEM_MODEL, - PROP, + REFRESH, DISPLAY_TEMP, DEVICE_NAME, DEVICE_CAPABILITIES, @@ -118,7 +118,7 @@ async def async_set_property_value(self, property_name: PropertyName, value: Pro if poll: data['datapoint']['echo'] = 0 - async with await self.ayla_api.async_request('post', end_point, json=data) as resp: + async with await self.ayla_api.async_request('post', end_point, json=data, headers={'x-ayla-source': 'Mobile'}) as resp: resp_data = await resp.json() if poll: @@ -173,7 +173,7 @@ async def async_poll_while(self, property: str, keep_polling_value: Any): await sleep(1) async def refresh_sensed_temp(self): - await self.async_set_property_value(PROP, 1, poll=True, keep_polling_value=1) + await self.async_set_property_value(REFRESH, 1) await super().async_update([DISPLAY_TEMP]) @property