File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
custom_components/weback_vacuum Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 49
49
VacDevice .ROBOT_ERROR : STATE_ERROR ,
50
50
}
51
51
52
+ # Some models report time in minutes, not seconds, we need to adjust
53
+ # calculations for them.
54
+ SUB_TYPES_REPORTING_MINUTES = [
55
+ "x-styleb" ,
56
+ ]
57
+
52
58
53
59
async def async_setup_platform (hass , config , async_add_entities , discovery_info = None ):
54
60
"""Set up the Weback robot vacuums."""
@@ -233,7 +239,10 @@ def extra_state_attributes(self) -> dict:
233
239
clean_time = self .device .robot_status ["clean_time" ]
234
240
if clean_time is None :
235
241
clean_time = 0
236
- extra_value ["clean_time" ] = (round (clean_time / 60 , 0 ),)
242
+ if self .device .sub_type in SUB_TYPES_REPORTING_MINUTES :
243
+ extra_value ["clean_time" ] = (clean_time ,)
244
+ else :
245
+ extra_value ["clean_time" ] = (round (clean_time / 60 , 0 ),)
237
246
238
247
return extra_value
239
248
You can’t perform that action at this time.
0 commit comments