11from dataclasses import fields
2- from typing import Self
32
43from roborock .data import AppInitStatus , RoborockProductNickname
54from roborock .device_features import DeviceFeatures
@@ -13,7 +12,7 @@ class DeviceFeaturesTrait(DeviceFeatures, common.V1TraitMixin):
1312
1413 command = RoborockCommand .APP_GET_INIT_STATUS
1514
16- def __init__ (self , product_nickname : RoborockProductNickname , cache : Cache ) -> None :
15+ def __init__ (self , product_nickname : RoborockProductNickname , cache : Cache ) -> None : # pylint: disable=super-init-not-called
1716 """Initialize MapContentTrait."""
1817 self ._nickname = product_nickname
1918 self ._cache = cache
@@ -22,7 +21,7 @@ def __init__(self, product_nickname: RoborockProductNickname, cache: Cache) -> N
2221 for field in fields (self ):
2322 setattr (self , field .name , False )
2423
25- async def refresh (self ) -> Self :
24+ async def refresh (self ) -> None :
2625 """Refresh the contents of this trait.
2726
2827 This will use cached device features if available since they do not
@@ -32,12 +31,11 @@ async def refresh(self) -> Self:
3231 cache_data = await self ._cache .get ()
3332 if cache_data .device_features is not None :
3433 self ._update_trait_values (cache_data .device_features )
35- return self
34+ return
3635 # Save cached device features
37- device_features = await super ().refresh ()
38- cache_data .device_features = device_features
36+ await super ().refresh ()
37+ cache_data .device_features = self
3938 await self ._cache .set (cache_data )
40- return device_features
4139
4240 def _parse_response (self , response : common .V1ResponseData ) -> DeviceFeatures :
4341 """Parse the response from the device into a MapContentTrait instance."""
0 commit comments