Skip to content

Commit 174aa46

Browse files
Update issues & workflow
1 parent d9a384a commit 174aa46

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

.github/ISSUE_TEMPLATE/new_device_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ body:
66
- type: markdown
77
attributes:
88
value: |
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)
9+
The battery library is a JSON document at [library/library.json](https://github.com/andrew-codechimp/HA-Battery-Notes/blob/main/library/library.json)
1010
To contribute, submit your device details via this form and the relevant code changes will be proposed on your behalf.
1111
1212
If you add a device manually in Battery Notes you will be able to see the details required at the top of the battery details panel, which is also available in the configure panel for the device within the Battery Notes integration once you have added it.

.github/scripts/library_doc/generate_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def generate_device_list():
1212

1313
# Load the existing JSON library file
1414
with open(
15-
"custom_components/battery_notes/data/library.json", encoding="UTF-8"
15+
"library/library.json", encoding="UTF-8"
1616
) as f:
1717
devices_json = json.loads(f.read())
1818
devices = devices_json.get("devices")

.github/workflows/json_librarian.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ jobs:
3232
import json
3333
3434
# Load the existing JSON library file
35-
with open("custom_components/battery_notes/data/library.json", "r", encoding="UTF-8") as f:
35+
with open("library/library.json", "r", encoding="UTF-8") as f:
3636
devices_json = json.loads(f.read())
3737
devices = devices_json.get("devices")
3838
3939
# Sort the devices by manufacturer and model
4040
devices.sort(key=lambda k: (k["manufacturer"].lower(), k.get("model_match_method", "").lower(), k["model"].lower(), k.get("model_id", "").lower(), k.get("hw_version", "").lower()))
41-
with open("custom_components/battery_notes/data/library.json", "w", encoding="UTF-8") as f:
41+
with open("library/library.json", "w", encoding="UTF-8") as f:
4242
f.write(json.dumps(devices_json, indent=4))
4343
4444
- name: Install library doc generator dependencies

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ coverage.xml
1515
config/*
1616
!config/configuration.yaml
1717
.DS_Store
18-
custom_components/battery_notes/data/library-dev.json
1918
config/configuration.yaml
2019

2120
custom_components/battery_notes/frontend/node_modules

docs/library.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Upon submission using the form above GitHub will attempt to make the required co
1414

1515
## Submit Definition via Pull Request
1616

17-
Fork the repository, add your device details to the JSON document `custom_components/battery_notes/data/library.json`, and then submit a pull request. Do not enable GitHub Actions (disabled by default) as this will mess with the pull request and are unnecessary for a library submission.
17+
Fork the repository, add your device details to the JSON document `library/library.json`, and then submit a pull request. Do not enable GitHub Actions (disabled by default) as this will mess with the pull request and are unnecessary for a library submission.
1818

1919
* The easiest way to get the correct device information is to add the device manually, on the battery type panel you will see a summary at the top of the details required to add to the library. This is also available if you go into configure of the device in battery notes.
2020
* The manufacturer and model should be exactly what is displayed on the Device screen within Home Assistant. If the Device screen has a Model ID or Hardware Version then this should be included.

0 commit comments

Comments
 (0)