Skip to content

feat: allow forcing of updating cache variables #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions roborock/version_1_apis/roborock_client_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ async def _async_value(self):
raise err
return self._value

async def async_value(self):
async def async_value(self, force: bool = False):
async with self._mutex:
if self._value is None:
if self._value is None or force:
return await self.task.reset()
return self._value

Expand Down Expand Up @@ -175,7 +175,7 @@ def status_type(self) -> type[Status]:
return self._status_type

async def get_status(self) -> Status:
data = self._status_type.from_dict(await self.cache[CacheableAttribute.status].async_value())
data = self._status_type.from_dict(await self.cache[CacheableAttribute.status].async_value(force=True))
if data is None:
return self._status_type()
return data
Expand Down