Browse Source

Add Support of maxWeight

docjyJ 4 years ago
parent
commit
c971d90595
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      washinsa/washinsa_handler.py

+ 8
- 0
washinsa/washinsa_handler.py View File

@@ -85,6 +85,13 @@ def is_machine_dryer(row):
85 85
     return DRYER_STRING in row.contents[0].text
86 86
 
87 87
 
88
+def get_machine_weight(row):
89
+    """
90
+    Find the maximum weight supported by the machine.
91
+    """
92
+    return int(re.search("LINGE (.*?) KG", row.contents[0].text).group(1))
93
+
94
+
88 95
 def get_machine_number(row):
89 96
     """
90 97
     Gets the current machine number.
@@ -184,6 +191,7 @@ def get_parsed_data(rows):
184 191
         machine = {
185 192
             "number": get_machine_number(row),
186 193
             "state": state.value,
194
+            "maxWeight ": get_machine_weight(row),
187 195
             "startTime": "",
188 196
             "endTime": "",
189 197
             "donePercent": "",

Loading…
Cancel
Save