roborock.data.b01_q7.b01_q7_containers
1from dataclasses import dataclass, field 2 3from ..containers import RoborockBase 4from .b01_q7_code_mappings import ( 5 B01Fault, 6 SCWindMapping, 7 WorkModeMapping, 8 WorkStatusMapping, 9) 10 11 12@dataclass 13class NetStatus(RoborockBase): 14 """Represents the network status of the device.""" 15 16 rssi: str 17 loss: int 18 ping: int 19 ip: str 20 mac: str 21 ssid: str 22 frequency: int 23 bssid: str 24 25 26@dataclass 27class OrderTotal(RoborockBase): 28 """Represents the order total information.""" 29 30 total: int 31 enable: int 32 33 34@dataclass 35class Privacy(RoborockBase): 36 """Represents the privacy settings of the device.""" 37 38 ai_recognize: int 39 dirt_recognize: int 40 pet_recognize: int 41 carpet_turbo: int 42 carpet_avoid: int 43 carpet_show: int 44 map_uploads: int 45 ai_agent: int 46 ai_avoidance: int 47 record_uploads: int 48 along_floor: int 49 auto_upgrade: int 50 51 52@dataclass 53class PvCharging(RoborockBase): 54 """Represents the photovoltaic charging status.""" 55 56 status: int 57 begin_time: int 58 end_time: int 59 60 61@dataclass 62class Recommend(RoborockBase): 63 """Represents cleaning recommendations.""" 64 65 sill: int 66 wall: int 67 room_id: list[int] = field(default_factory=list) 68 69 70@dataclass 71class B01Props(RoborockBase): 72 """ 73 Represents the complete properties and status for a Roborock B01 model. 74 This dataclass is generated based on the device's status JSON object. 75 """ 76 77 status: WorkStatusMapping | None = None 78 fault: B01Fault | None = None 79 wind: SCWindMapping | None = None 80 water: int | None = None 81 mode: int | None = None 82 quantity: int | None = None 83 alarm: int | None = None 84 volume: int | None = None 85 hypa: int | None = None 86 main_brush: int | None = None 87 side_brush: int | None = None 88 mop_life: int | None = None 89 main_sensor: int | None = None 90 net_status: NetStatus | None = None 91 repeat_state: int | None = None 92 tank_state: int | None = None 93 sweep_type: int | None = None 94 clean_path_preference: int | None = None 95 cloth_state: int | None = None 96 time_zone: int | None = None 97 time_zone_info: str | None = None 98 language: int | None = None 99 cleaning_time: int | None = None 100 real_clean_time: int | None = None 101 cleaning_area: int | None = None 102 custom_type: int | None = None 103 sound: int | None = None 104 work_mode: WorkModeMapping | None = None 105 station_act: int | None = None 106 charge_state: int | None = None 107 current_map_id: int | None = None 108 map_num: int | None = None 109 dust_action: int | None = None 110 quiet_is_open: int | None = None 111 quiet_begin_time: int | None = None 112 quiet_end_time: int | None = None 113 clean_finish: int | None = None 114 voice_type: int | None = None 115 voice_type_version: int | None = None 116 order_total: OrderTotal | None = None 117 build_map: int | None = None 118 privacy: Privacy | None = None 119 dust_auto_state: int | None = None 120 dust_frequency: int | None = None 121 child_lock: int | None = None 122 multi_floor: int | None = None 123 map_save: int | None = None 124 light_mode: int | None = None 125 green_laser: int | None = None 126 dust_bag_used: int | None = None 127 order_save_mode: int | None = None 128 manufacturer: str | None = None 129 back_to_wash: int | None = None 130 charge_station_type: int | None = None 131 pv_cut_charge: int | None = None 132 pv_charging: PvCharging | None = None 133 serial_number: str | None = None 134 recommend: Recommend | None = None 135 add_sweep_status: int | None = None 136 137 @property 138 def main_brush_time_left(self) -> int | None: 139 """ 140 Returns estimated remaining life of the main brush in minutes. 141 Total life is 300 hours (18000 minutes). 142 """ 143 if self.main_brush is None: 144 return None 145 return max(0, 18000 - self.main_brush) 146 147 @property 148 def side_brush_time_left(self) -> int | None: 149 """ 150 Returns estimated remaining life of the side brush in minutes. 151 Total life is 200 hours (12000 minutes). 152 """ 153 if self.side_brush is None: 154 return None 155 return max(0, 12000 - self.side_brush) 156 157 @property 158 def filter_time_left(self) -> int | None: 159 """ 160 Returns estimated remaining life of the filter (hypa) in minutes. 161 Total life is 150 hours (9000 minutes). 162 """ 163 if self.hypa is None: 164 return None 165 return max(0, 9000 - self.hypa) 166 167 @property 168 def mop_life_time_left(self) -> int | None: 169 """ 170 Returns estimated remaining life of the mop in minutes. 171 Total life is 180 hours (10800 minutes). 172 """ 173 if self.mop_life is None: 174 return None 175 return max(0, 10800 - self.mop_life) 176 177 @property 178 def sensor_dirty_time_left(self) -> int | None: 179 """ 180 Returns estimated time until sensors need cleaning in minutes. 181 Maintenance interval is typically 30 hours (1800 minutes). 182 """ 183 if self.main_sensor is None: 184 return None 185 return max(0, 1800 - self.main_sensor) 186 187 @property 188 def status_name(self) -> str | None: 189 """Returns the name of the current status.""" 190 return self.status.value if self.status is not None else None 191 192 @property 193 def fault_name(self) -> str | None: 194 """Returns the name of the current fault.""" 195 return self.fault.value if self.fault is not None else None 196 197 @property 198 def wind_name(self) -> str | None: 199 """Returns the name of the current fan speed (wind).""" 200 return self.wind.value if self.wind is not None else None 201 202 @property 203 def work_mode_name(self) -> str | None: 204 """Returns the name of the current work mode.""" 205 return self.work_mode.value if self.work_mode is not None else None
13@dataclass 14class NetStatus(RoborockBase): 15 """Represents the network status of the device.""" 16 17 rssi: str 18 loss: int 19 ping: int 20 ip: str 21 mac: str 22 ssid: str 23 frequency: int 24 bssid: str
Represents the network status of the device.
Inherited Members
27@dataclass 28class OrderTotal(RoborockBase): 29 """Represents the order total information.""" 30 31 total: int 32 enable: int
Represents the order total information.
Inherited Members
35@dataclass 36class Privacy(RoborockBase): 37 """Represents the privacy settings of the device.""" 38 39 ai_recognize: int 40 dirt_recognize: int 41 pet_recognize: int 42 carpet_turbo: int 43 carpet_avoid: int 44 carpet_show: int 45 map_uploads: int 46 ai_agent: int 47 ai_avoidance: int 48 record_uploads: int 49 along_floor: int 50 auto_upgrade: int
Represents the privacy settings of the device.
Inherited Members
53@dataclass 54class PvCharging(RoborockBase): 55 """Represents the photovoltaic charging status.""" 56 57 status: int 58 begin_time: int 59 end_time: int
Represents the photovoltaic charging status.
Inherited Members
62@dataclass 63class Recommend(RoborockBase): 64 """Represents cleaning recommendations.""" 65 66 sill: int 67 wall: int 68 room_id: list[int] = field(default_factory=list)
Represents cleaning recommendations.
Inherited Members
71@dataclass 72class B01Props(RoborockBase): 73 """ 74 Represents the complete properties and status for a Roborock B01 model. 75 This dataclass is generated based on the device's status JSON object. 76 """ 77 78 status: WorkStatusMapping | None = None 79 fault: B01Fault | None = None 80 wind: SCWindMapping | None = None 81 water: int | None = None 82 mode: int | None = None 83 quantity: int | None = None 84 alarm: int | None = None 85 volume: int | None = None 86 hypa: int | None = None 87 main_brush: int | None = None 88 side_brush: int | None = None 89 mop_life: int | None = None 90 main_sensor: int | None = None 91 net_status: NetStatus | None = None 92 repeat_state: int | None = None 93 tank_state: int | None = None 94 sweep_type: int | None = None 95 clean_path_preference: int | None = None 96 cloth_state: int | None = None 97 time_zone: int | None = None 98 time_zone_info: str | None = None 99 language: int | None = None 100 cleaning_time: int | None = None 101 real_clean_time: int | None = None 102 cleaning_area: int | None = None 103 custom_type: int | None = None 104 sound: int | None = None 105 work_mode: WorkModeMapping | None = None 106 station_act: int | None = None 107 charge_state: int | None = None 108 current_map_id: int | None = None 109 map_num: int | None = None 110 dust_action: int | None = None 111 quiet_is_open: int | None = None 112 quiet_begin_time: int | None = None 113 quiet_end_time: int | None = None 114 clean_finish: int | None = None 115 voice_type: int | None = None 116 voice_type_version: int | None = None 117 order_total: OrderTotal | None = None 118 build_map: int | None = None 119 privacy: Privacy | None = None 120 dust_auto_state: int | None = None 121 dust_frequency: int | None = None 122 child_lock: int | None = None 123 multi_floor: int | None = None 124 map_save: int | None = None 125 light_mode: int | None = None 126 green_laser: int | None = None 127 dust_bag_used: int | None = None 128 order_save_mode: int | None = None 129 manufacturer: str | None = None 130 back_to_wash: int | None = None 131 charge_station_type: int | None = None 132 pv_cut_charge: int | None = None 133 pv_charging: PvCharging | None = None 134 serial_number: str | None = None 135 recommend: Recommend | None = None 136 add_sweep_status: int | None = None 137 138 @property 139 def main_brush_time_left(self) -> int | None: 140 """ 141 Returns estimated remaining life of the main brush in minutes. 142 Total life is 300 hours (18000 minutes). 143 """ 144 if self.main_brush is None: 145 return None 146 return max(0, 18000 - self.main_brush) 147 148 @property 149 def side_brush_time_left(self) -> int | None: 150 """ 151 Returns estimated remaining life of the side brush in minutes. 152 Total life is 200 hours (12000 minutes). 153 """ 154 if self.side_brush is None: 155 return None 156 return max(0, 12000 - self.side_brush) 157 158 @property 159 def filter_time_left(self) -> int | None: 160 """ 161 Returns estimated remaining life of the filter (hypa) in minutes. 162 Total life is 150 hours (9000 minutes). 163 """ 164 if self.hypa is None: 165 return None 166 return max(0, 9000 - self.hypa) 167 168 @property 169 def mop_life_time_left(self) -> int | None: 170 """ 171 Returns estimated remaining life of the mop in minutes. 172 Total life is 180 hours (10800 minutes). 173 """ 174 if self.mop_life is None: 175 return None 176 return max(0, 10800 - self.mop_life) 177 178 @property 179 def sensor_dirty_time_left(self) -> int | None: 180 """ 181 Returns estimated time until sensors need cleaning in minutes. 182 Maintenance interval is typically 30 hours (1800 minutes). 183 """ 184 if self.main_sensor is None: 185 return None 186 return max(0, 1800 - self.main_sensor) 187 188 @property 189 def status_name(self) -> str | None: 190 """Returns the name of the current status.""" 191 return self.status.value if self.status is not None else None 192 193 @property 194 def fault_name(self) -> str | None: 195 """Returns the name of the current fault.""" 196 return self.fault.value if self.fault is not None else None 197 198 @property 199 def wind_name(self) -> str | None: 200 """Returns the name of the current fan speed (wind).""" 201 return self.wind.value if self.wind is not None else None 202 203 @property 204 def work_mode_name(self) -> str | None: 205 """Returns the name of the current work mode.""" 206 return self.work_mode.value if self.work_mode is not None else None
Represents the complete properties and status for a Roborock B01 model. This dataclass is generated based on the device's status JSON object.
138 @property 139 def main_brush_time_left(self) -> int | None: 140 """ 141 Returns estimated remaining life of the main brush in minutes. 142 Total life is 300 hours (18000 minutes). 143 """ 144 if self.main_brush is None: 145 return None 146 return max(0, 18000 - self.main_brush)
Returns estimated remaining life of the main brush in minutes. Total life is 300 hours (18000 minutes).
148 @property 149 def side_brush_time_left(self) -> int | None: 150 """ 151 Returns estimated remaining life of the side brush in minutes. 152 Total life is 200 hours (12000 minutes). 153 """ 154 if self.side_brush is None: 155 return None 156 return max(0, 12000 - self.side_brush)
Returns estimated remaining life of the side brush in minutes. Total life is 200 hours (12000 minutes).
158 @property 159 def filter_time_left(self) -> int | None: 160 """ 161 Returns estimated remaining life of the filter (hypa) in minutes. 162 Total life is 150 hours (9000 minutes). 163 """ 164 if self.hypa is None: 165 return None 166 return max(0, 9000 - self.hypa)
Returns estimated remaining life of the filter (hypa) in minutes. Total life is 150 hours (9000 minutes).
168 @property 169 def mop_life_time_left(self) -> int | None: 170 """ 171 Returns estimated remaining life of the mop in minutes. 172 Total life is 180 hours (10800 minutes). 173 """ 174 if self.mop_life is None: 175 return None 176 return max(0, 10800 - self.mop_life)
Returns estimated remaining life of the mop in minutes. Total life is 180 hours (10800 minutes).
178 @property 179 def sensor_dirty_time_left(self) -> int | None: 180 """ 181 Returns estimated time until sensors need cleaning in minutes. 182 Maintenance interval is typically 30 hours (1800 minutes). 183 """ 184 if self.main_sensor is None: 185 return None 186 return max(0, 1800 - self.main_sensor)
Returns estimated time until sensors need cleaning in minutes. Maintenance interval is typically 30 hours (1800 minutes).
188 @property 189 def status_name(self) -> str | None: 190 """Returns the name of the current status.""" 191 return self.status.value if self.status is not None else None
Returns the name of the current status.
193 @property 194 def fault_name(self) -> str | None: 195 """Returns the name of the current fault.""" 196 return self.fault.value if self.fault is not None else None
Returns the name of the current fault.
198 @property 199 def wind_name(self) -> str | None: 200 """Returns the name of the current fan speed (wind).""" 201 return self.wind.value if self.wind is not None else None
Returns the name of the current fan speed (wind).
203 @property 204 def work_mode_name(self) -> str | None: 205 """Returns the name of the current work mode.""" 206 return self.work_mode.value if self.work_mode is not None else None
Returns the name of the current work mode.