Skip to content

Commit

Permalink
Merge pull request #32 from crevetor/fix-refresh
Browse files Browse the repository at this point in the history
Fix refreshing of the  sensed temperature
  • Loading branch information
rewardone committed Sep 10, 2024
2 parents 570cb97 + 3993b9d commit b3bd098
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ayla_iot_unofficial/fujitsu_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}

OEM_MODEL = "oem_model"
PROP = "prop"
REFRESH = "refresh"
DISPLAY_TEMP = "display_temperature"
DEVICE_NAME = "device_name"
DEVICE_CAPABILITIES = "device_capabilities"
Expand Down
6 changes: 3 additions & 3 deletions src/ayla_iot_unofficial/fujitsu_hvac.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -136,7 +136,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:
Expand Down Expand Up @@ -196,7 +196,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
Expand Down

0 comments on commit b3bd098

Please sign in to comment.