Skip to content

Commit

Permalink
update new-device.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bmos committed Dec 15, 2023
1 parent a9fc0aa commit 67dea69
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/new-device.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
uses: jannekem/run-python-script-action@v1
with:
script: |
import os
import json
# Load the existing JSON library file
Expand All @@ -58,12 +57,9 @@ jobs:
devices.append(new_device)
# Save manufacturer and model string for use in naming the pull request
def set_action_outputs(output_pairs) :
if "GITHUB_OUTPUT" in os.environ :
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
for key, value in output_pairs.items():
print(f"{key}={value}", file=f)
set_action_outputs(new_device)
print(f"'mm={device["manufacturer"]} - {device["model"]}' >> '$GITHUB_OUTPUT'")
# print(f"'manufacturer={device["manufacturer"]}' >> '$GITHUB_OUTPUT'")
# print(f"'model={device["model"]}' >> '$GITHUB_OUTPUT'")
with open("custom_components/battery_notes/data/library.json", "w") as f:
f.write(json.dumps(devices_json, indent=2))
Expand Down

0 comments on commit 67dea69

Please sign in to comment.