Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/release-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release checks

on:
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
card:
name: Card, tests, and TypeScript
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: "22"
cache: npm
- run: npm ci
- run: npm test
- run: npm run typecheck
- run: npm run build:release
- run: node --check solar-panel-visualizer.js
128 changes: 128 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Create Draft Release

on:
workflow_dispatch:
inputs:
tag:
description: "Existing version tag on main, for example 0.2.5"
required: true
type: string

permissions:
contents: read

concurrency:
group: draft-release-${{ inputs.tag }}
cancel-in-progress: false

jobs:
preflight:
runs-on: ubuntu-24.04
outputs:
release_sha: ${{ steps.verify.outputs.release_sha }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Verify main, tag, version, and release notes
id: verify
env:
RELEASE_TAG: ${{ inputs.tag }}
run: |
if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then
echo "Run Create Draft Release from the main branch." >&2
exit 1
fi
if [[ ! "$RELEASE_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Enter a version such as 0.2.5, without a v prefix." >&2
exit 1
fi
git fetch origin main:refs/remotes/origin/main
git fetch origin "refs/tags/$RELEASE_TAG:refs/tags/$RELEASE_TAG"
release_sha=$(git rev-parse "refs/tags/$RELEASE_TAG^{commit}")
if ! git merge-base --is-ancestor "$release_sha" origin/main; then
echo "Tag $RELEASE_TAG must point to a commit on main." >&2
exit 1
fi
tag_version=$(git show "$release_sha:package.json" | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>process.stdout.write(JSON.parse(s).version))')
if [[ "$tag_version" != "$RELEASE_TAG" ]]; then
echo "Tag $RELEASE_TAG does not match package.json version $tag_version." >&2
exit 1
fi
git show "$release_sha:CHANGELOG.md" | grep -Fq "## [$RELEASE_TAG] -"
git show "$release_sha:RELEASE_NOTES.md" | grep -Fq "# Solar Panel Visualizer $RELEASE_TAG"
echo "release_sha=$release_sha" >> "$GITHUB_OUTPUT"

checks:
needs: preflight
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
ref: ${{ needs.preflight.outputs.release_sha }}
- uses: actions/setup-node@v7
with:
node-version: "22"
cache: npm
- run: npm ci
- run: npm test
- run: npm run typecheck
- run: npm run build:release
- run: node --check solar-panel-visualizer.js
- name: Build and verify install package
env:
RELEASE_TAG: ${{ inputs.tag }}
run: python3 scripts/package_release.py --version "$RELEASE_TAG" --output-dir dist
- uses: actions/upload-artifact@v8
with:
name: solar-panel-visualizer-release
path: dist/solar-panel-visualizer-${{ inputs.tag }}.zip
if-no-files-found: error

validate-hacs:
needs: preflight
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
ref: ${{ needs.preflight.outputs.release_sha }}
- name: HACS plugin validation
uses: hacs/action@main
with:
category: plugin

draft-release:
needs: [preflight, checks, validate-hacs]
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
ref: ${{ needs.preflight.outputs.release_sha }}
- uses: actions/download-artifact@v8
with:
name: solar-panel-visualizer-release
path: dist
- name: Recheck tag before creating draft
env:
RELEASE_TAG: ${{ inputs.tag }}
RELEASE_SHA: ${{ needs.preflight.outputs.release_sha }}
run: |
git fetch origin "refs/tags/$RELEASE_TAG:refs/tags/$RELEASE_TAG"
test "$(git rev-parse "refs/tags/$RELEASE_TAG^{commit}")" = "$RELEASE_SHA"
- name: Create unpublished draft
env:
GH_TOKEN: ${{ github.token }}
GH_PROMPT_DISABLED: "1"
RELEASE_TAG: ${{ inputs.tag }}
run: |
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
echo "A GitHub release already exists for $RELEASE_TAG." >&2
exit 1
fi
gh release create "$RELEASE_TAG" \
"dist/solar-panel-visualizer-$RELEASE_TAG.zip" \
--draft --verify-tag \
--title "Solar Panel Visualizer $RELEASE_TAG" \
--notes-file RELEASE_NOTES.md
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
node_modules
coverage
.DS_Store
*.tsbuildinfo
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [0.2.5] - 2026-11-05

### Fixed
- Restored GUI switch labels for Home Assistant 2026.11 and later by using the supported `ha-switch` label slot.
- Added a tested GitHub Actions draft-release flow for the packaged HACS card.
- Fixed strict TypeScript errors so type checking can run as a release gate.

## [0.2.4] - 2026-06-21

### Added
Expand All @@ -23,6 +30,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- README setup documentation now explains the safer auto-fill behavior for power, energy, inverter/panel status, and advanced telemetry.

### Fixed
- Added `waiting` to the default inverter/panel working status terms, so a plain `Waiting` state is treated as normal.
- Energy auto-fill and energy selectors now accept Home Assistant `device_class: energy`, so friendly-name searches such as `Yield Today` can find inverter daily yield sensors even when the unit is missing or unusual.
- Status auto-fill now tries clear one-to-one panel status matches before falling back to shared inverter/string status, fixing panels named like `sensor.power_1_0_#` with matching `sensor.status_1_0_#`.
- String setup now regenerates old automatic names such as `String 2 Panel 3` after layout changes, preventing duplicate stale panel names while preserving custom names.
Expand Down
16 changes: 16 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Solar Panel Visualizer 0.2.5

Release date: 2026-11-05

This release restores the GUI setting labels in Home Assistant 2026.11 and adds a tested, manually reviewed draft-release workflow.

## Fixed

- Replaced removed `ha-formfield` wrappers with labels rendered by `ha-switch` across the editor and panel quick setup.
- Corrected strict TypeScript errors and added type checking to the release checks.

## Install

Update Solar Panel Visualizer from HACS, then reload the Home Assistant frontend if HACS asks you to.

No manual YAML changes are required. Existing card configurations continue to work.
195 changes: 81 additions & 114 deletions dist/solar-panel-visualizer.js

Large diffs are not rendered by default.

Loading
Loading