You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/new_device.yaml
+14-5Lines changed: 14 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -57,16 +57,20 @@ jobs:
57
57
if new_device.get("battery_type", "").lower() == "rechargable":
58
58
new_device["battery_type"] = "Rechargeable"
59
59
60
-
# Check for duplicates and replace old entry with new one
60
+
# Check for duplicates and replace old entry with new one, flagging manual entries
61
61
duplicate_found = False
62
+
manual_found = False
62
63
for i, device in enumerate(devices):
63
64
if device["manufacturer"] == new_device["manufacturer"] and device["model"] == new_device["model"] and device.get("model_id", "") == new_device.get("model_id", "") and device.get("hw_version", "") == new_device.get("hw_version", ""):
65
+
if device["battery_type"].upper() == "MANUAL":
66
+
manual_found = True
67
+
break
64
68
devices[i] = new_device
65
69
duplicate_found = True
66
70
break
67
71
68
-
# If no duplicate found, add the new device to the JSON library file
69
-
if not duplicate_found:
72
+
# If no duplicate found and not currently manual, add the new device to the JSON library file
0 commit comments