Skip to content

Commit

Permalink
Add HA minimal version updating in hacs.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Jun 29, 2022
1 parent 38a338f commit 59ecff8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions bin/update_manifest
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ fi

component=$(ls -q "${ROOT}/custom_components/" | grep -v __ | head -n 1)
const_path="custom_components/${component}/const.py"
reqs_path="requirements.txt"

name=$(grep "^NAME: Final =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/")
domain=$(grep "^DOMAIN: Final =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/")
version=$(grep "^VERSION: Final =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/")
issue_url=$(grep "^ISSUE_URL: Final =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/")
ha_version=$(grep "^homeassistant>=" ${reqs_path} | sed -E "s/^[^=]+=(\S*).*$/\\1/")

log.info "Update manifest.json data..."
manifest_path="custom_components/${component}/manifest.json"
Expand All @@ -32,3 +34,4 @@ sed -i -E "s!(\"issue_tracker\": \")[^\"]*!\\1${issue_url}!" ${manifest_path}
log.info "Update hacs.json data..."
hacs_path="${ROOT}/hacs.json"
sed -i -E "s!(\"name\": \")[^\"]*!\\1${name}!" ${hacs_path}
sed -i -E "s!(\"homeassistant\": \")[^\"]*!\\1${ha_version}!" ${hacs_path}
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Integration blueprint",
"hacs": "1.6.0",
"homeassistant": "0.118.0"
"homeassistant": "2022.6.0"
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
homeassistant>=2022.4
homeassistant>=2022.6.0

0 comments on commit 59ecff8

Please sign in to comment.