Skip to content

Commit eae7803

Browse files
authored
feat: allow forcing of updating cache variables (#355)
1 parent 03b0eaa commit eae7803

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

roborock/version_1_apis/roborock_client_v1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ async def _async_value(self):
107107
raise err
108108
return self._value
109109

110-
async def async_value(self):
110+
async def async_value(self, force: bool = False):
111111
async with self._mutex:
112-
if self._value is None:
112+
if self._value is None or force:
113113
return await self.task.reset()
114114
return self._value
115115

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

177177
async def get_status(self) -> Status:
178-
data = self._status_type.from_dict(await self.cache[CacheableAttribute.status].async_value())
178+
data = self._status_type.from_dict(await self.cache[CacheableAttribute.status].async_value(force=True))
179179
if data is None:
180180
return self._status_type()
181181
return data

0 commit comments

Comments
 (0)