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/ISSUE_TEMPLATE/new_device_request.yml
+23-4Lines changed: 23 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ body:
9
9
The battery library is a JSON document at [custom_components/battery_notes/data/library.json](https://github.com/andrew-codechimp/HA-Battery-Notes/blob/main/custom_components/battery_notes/data/library.json)
10
10
To contribute, submit your device details via this form and the relevant code changes will be proposed on your behalf.
11
11
Note: The title above is not used and can be just a friendly description of the device. Manufacturer and model should be exactly what is displayed on the Device screen within Home Assistant.
12
+
If your device has a Model ID or HW Version then these must be included.
12
13
To see your devices, click here:
13
14
14
15
[](https://my.home-assistant.io/redirect/devices/)
@@ -18,7 +19,7 @@ body:
18
19
attributes:
19
20
label: Manufacturer
20
21
description: The manufacturer should be exactly what is displayed on the Devices screen within Home Assistant.
21
-
placeholder: ex. eWeLink
22
+
placeholder: ex. Philips
22
23
validations:
23
24
required: true
24
25
@@ -27,12 +28,30 @@ body:
27
28
attributes:
28
29
label: Model
29
30
description: The model should be exactly what is displayed on the Devices screen within Home Assistant.
30
-
placeholder: ex. DS01
31
+
placeholder: ex. Hue dimmer switch
31
32
validations:
32
33
required: true
33
34
34
35
- type: input
35
-
id: battery-type
36
+
id: model_id
37
+
attributes:
38
+
label: Model ID
39
+
description: If the device has a Model ID in the Devices screen within Home Assistant it must be included.
40
+
placeholder: ex. 324131092621
41
+
validations:
42
+
required: false
43
+
44
+
- type: input
45
+
id: hw_version
46
+
attributes:
47
+
label: HW Version
48
+
description: If the device has a Hardware version shown in the Devices screen within Home Assistant it must be included.
49
+
placeholder: ex. V7.2
50
+
validations:
51
+
required: false
52
+
53
+
- type: input
54
+
id: battery_type
36
55
attributes:
37
56
label: Battery Type
38
57
description: When specifying battery types please use the Most Common naming for general batteries and the IEC naming for battery cells according to [Wikipedia](https://en.wikipedia.org/wiki/List_of_battery_sizes).
@@ -41,7 +60,7 @@ body:
41
60
required: true
42
61
43
62
- type: input
44
-
id: battery-quantity
63
+
id: battery_quantity
45
64
attributes:
46
65
label: Battery Quantity
47
66
description: The battery_quantity attribute is numeric (no letters or special characters).
# Add numeric "battery_quantity" key if it's more than 1
49
49
if numeric_quantity > 1:
50
50
new_device["battery_quantity"] = numeric_quantity
51
+
if new_device.get("model_id", "MISSING").strip() == "":
52
+
del new_device["model_id"]
53
+
if new_device.get("hw_version", "MISSING").strip() == "":
54
+
del new_device["hw_version"]
51
55
52
56
# Check for duplicates and replace old entry with new one
53
57
duplicate_found = False
54
58
for i, device in enumerate(devices):
55
-
if device["manufacturer"] == new_device["manufacturer"] and device["model"] == new_device["model"]:
59
+
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", ""):
run: gh issue close --comment "Thanks for the contribution. We're auto-closing this issue. If it's a new device, a pull request will be created that will be reviewed and merged." ${{github.event.issue.number}}
0 commit comments