Commit graph

33 commits

Author SHA1 Message Date
Julian Pawlowski
c9923d9475 chore(copilot): Remove reference to CLAUDE.md as it is no longer needed in the repository. 2025-11-10 12:11:42 +00:00
Julian Pawlowski
3dc1a49465 feat(docs): enhance period calculation documentation and add detailed guides for best/peak price periods 2025-11-10 11:54:06 +00:00
Julian Pawlowski
b36a94d53b feat(translations): update language style and tone for user instructions across multiple languages 2025-11-09 19:27:42 +00:00
Julian Pawlowski
850e985ef8 feat(release): enhance generate-release-notes with AI optimization and auto-update
Major improvements to release note generation system:

**AI Model Optimization:**
- Switch from Claude Sonnet 4.5 to Haiku 4.5 (67% cheaper, 50% faster)
- Cost reduced from 1.0 to 0.33 Premium requests per generation
- Generation time reduced from ~30s to ~15s
- Quality maintained through improved prompt engineering

**Improved Prompt Structure:**
- Restructured prompt: instructions first, commit data last
- Added explicit user-feature prioritization rules (sensors > config > developer tools)
- Integrated file change statistics with each commit
- Added file path guidance (custom_components/ = HIGH, scripts/ = LOW)
- Added 3-step decision process with walkthrough example
- Added explicit output constraints to prevent meta-commentary

**Auto-Update Feature:**
- Consolidated improve-release-notes functionality into generate-release-notes
- Automatic detection of existing GitHub releases
- Interactive prompt to update both title and body
- Shows comparison: current title vs. new AI-generated title

**File Statistics Integration:**
- Added --stat --compact-summary to git log
- Shows which files changed in each commit with line counts
- Helps AI quantitatively assess change importance (100+ lines = significant)
- Enables better prioritization of user-facing features

**Testing Results:**
- Generated title: "Price Volatility Analysis & Configuration" (user-focused!)
- Successfully prioritizes user features over developer/CI changes
- No more generic "New Features & Bug Fixes" titles
- Thematic titles that capture main release highlights

Impact: Release note generation is now faster, cheaper, and produces
higher-quality user-focused titles. Single consolidated script handles
both generation and updating existing releases.
2025-11-09 17:51:15 +00:00
Julian Pawlowski
0832c5c071 feat(release): add dynamic release title generation
Release titles now automatically reflect the type of changes:
- 'vX.Y.Z - New Features & Bug Fixes' (both present)
- 'vX.Y.Z - New Features' (only features)
- 'vX.Y.Z - Bug Fixes' (only fixes)
- 'vX.Y.Z' (fallback for other changes)

Determined by analyzing commit messages between previous tag and current tag.

Impact: Release titles are more descriptive and immediately show what
changed, making it easier for users to understand the release at a glance.
2025-11-09 16:33:46 +00:00
Julian Pawlowski
256caab2ff feat(workflows): add concurrency control to prevent duplicate runs
Added concurrency groups with cancel-in-progress to validate.yml, lint.yml,
and auto-tag.yml workflows.

This ensures that when multiple commits are pushed quickly:
- Only the latest validation/lint run continues
- Older runs are automatically cancelled
- Saves CI minutes and provides faster feedback

Release workflow intentionally excluded (each tag is unique).

Impact: More efficient CI usage, faster feedback on rapid commits.
2025-11-09 16:30:34 +00:00
Julian Pawlowski
605e05ea95 fix(workflows): remove duplicate validation runs in release workflow
Release workflow now trusts that validate.yml and lint.yml have already
run on the main branch commit before tag creation. This prevents duplicate
workflow executions.

Workflow execution flow:
1. Push to main → validate.yml + lint.yml run (quality gate)
2. prepare-release or auto-tag creates version tag
3. release.yml runs (generates release notes, no validation)

This ensures:
- Every main commit is validated/linted before tag creation
- No duplicate workflow runs (validate/lint run once per commit)
- Release workflow is faster (no redundant checks)
- Simple, predictable workflow chain

Impact: Release process is more efficient and workflows don't run twice.
2025-11-09 16:26:16 +00:00
Julian Pawlowski
6614d225e3 fix(release): add validation/lint checks before release and clean output
Added mandatory validation steps to release workflow:
- Job 1: validate (hassfest + HACS) - runs before release
- Job 2: lint (Ruff check + format) - runs before release
- Job 3: sync-manifest - only runs if validation passes
- Job 4: release-notes - only runs if all previous jobs pass

This ensures no release is created if code doesn't pass validation.

Fixed generate-release-notes script to suppress colored output in CI:
- Added log_info() wrapper that sends output to stderr in CI
- Keeps release notes clean (only markdown, no ANSI codes)
- Local execution still shows colored output for better UX

Impact: Release workflow now fails fast if validation fails. Release
notes are clean without shell output artifacts.
2025-11-09 16:14:07 +00:00
Julian Pawlowski
6ebcdc90c0 docs(workflow): document release automation and validation patterns
Updated copilot-instructions.md with comprehensive documentation for
new release workflows and validation requirements.

Added sections:
- Selector validation rules for hassfest compliance
  - Pattern requirement: [a-z0-9-_]+ (lowercase only)
  - Common pitfalls with SelectOptionDict and translation_key
  - Validation examples (correct vs incorrect)

- Legacy/Backwards compatibility guidelines
  - When to add migration code vs breaking changes
  - check-if-released script usage
  - Rule: Only migrate for released changes
  - Prefer documentation over complexity

- Semantic versioning workflow
  - Pre-1.0 vs Post-1.0 versioning rules
  - suggest-version script usage and output
  - prepare-release integration
  - Version check in CI/CD

- Release notes generation
  - Updated with auto-sync and version check features
  - Backend comparison (AI vs git-cliff vs manual)
  - Complete workflow examples

Impact: AI assistant and developers have clear guidance on hassfest
requirements, legacy migration decisions, and the complete release
automation workflow. Reduces errors and maintains consistency across
sessions.
2025-11-09 15:33:26 +00:00
Julian Pawlowski
d7a145d678 feat(ci): add manifest sync and version validation to release workflow
Implemented automatic manifest.json synchronization and semantic
versioning validation in the release workflow.

Auto-Sync Manifest (sync-manifest job):
- Extracts version from Git tag (v*.*.*)
- Compares with manifest.json version
- Auto-updates manifest.json if mismatch detected
- Commits changes back to main branch
- Sets outputs (updated, version) for downstream jobs
- Prevents HACS version mismatches and conflicts with auto-tag.yml

Version Check Warning System (version_check step):
- Analyzes commits between tags for breaking changes, features, fixes
- Applies semantic versioning rules (pre-1.0 and post-1.0)
- Detects inappropriate version bumps:
  - Features with only PATCH bump → suggests MINOR
  - Breaking changes with only MINOR bump → suggests MAJOR (post-1.0)
  - Breaking changes with only PATCH bump → suggests MINOR (pre-1.0)
- Shows warnings in GitHub Step Summary (prominent)
- Appends warnings to release notes body
- Provides fix instructions but doesn't fail workflow
- Updates final summary with version check status

Workflow changes:
- release-notes job now depends on sync-manifest
- Checks out main branch to get updated manifest if synced
- Summary shows manifest sync status and version check result

Impact: Prevents manual version tag issues, maintains manifest
consistency, and warns about semantic versioning violations without
blocking releases. Fully transparent workflow with clear guidance.
2025-11-09 15:33:07 +00:00
Julian Pawlowski
df79afc87e docs: restructure documentation and add AI development disclosure
Created professional documentation structure:

**User Documentation (docs/user/):**
- README.md: Documentation hub with quick start guide
- Placeholder files for future content migration:
  * installation.md, configuration.md, sensors.md
  * services.md, automation-examples.md, troubleshooting.md

**Developer Documentation (docs/development/):**
- README.md: Comprehensive contributor guide with AI section
- setup.md: DevContainer and environment setup
- architecture.md: Code structure overview
- testing.md: Testing guidelines
- coding-guidelines.md: Style guide and critical patterns
- release-management.md: Complete release workflow documentation

**AI Development Disclosure:**
- README.md: "🤖 Development Note" section before license
  * Honest disclosure about extensive AI assistance
  * Quality assurance measures mentioned
  * Invitation for bug reports with positive tone
- docs/development/README.md: Detailed AI section
  * What AI handles (patterns, generation, refactoring)
  * Benefits (rapid development, consistency)
  * Limitations (edge cases, complex patterns)
  * Quality assurance process
- CONTRIBUTING.md: Brief AI note with practical tip

**Updated:**
- README.md: Simplified to landing page with documentation links
- CONTRIBUTING.md: Modernized with new docs structure
- copilot-instructions.md: Added documentation organization section

Impact: Clear separation of user vs. developer documentation following
open-source best practices. Transparent about AI-assisted development
approach without being defensive. Scalable structure for future growth.
2025-11-09 14:25:27 +00:00
Julian Pawlowski
e08fd60070 feat(release): add automated release notes generation system
Implemented multi-backend release notes generation:

**Scripts:**
- prepare-release: Bump manifest.json + create tag (foolproof workflow)
- generate-release-notes: Parse conventional commits with 3 backends
  * GitHub Copilot CLI (AI-powered, smart grouping)
  * git-cliff (template-based, fast and reliable)
  * Manual grep/awk (fallback, always works)
- setup: Auto-install git-cliff via cargo in DevContainer

**GitHub Actions:**
- auto-tag.yml: Automatically create tag on manifest.json version bump
- release.yml: Generate release notes and create GitHub release on tag push
- release.yml: Button config for GitHub UI release notes generator

**Configuration:**
- cliff.toml: Smart filtering rules
  * Excludes: manifest bumps, dev-env changes, CI/CD changes
  * Includes: Dependency updates (relevant for users)
  * Groups by conventional commit type with emoji

**Workflow:**
1. Run `./scripts/prepare-release 0.3.0`
2. Push commit + tag: `git push origin main v0.3.0`
3. CI/CD automatically generates release notes and creates GitHub release

Impact: Maintainers can prepare professional releases with one command.
Release notes are automatically generated from conventional commits with
intelligent filtering and categorization.
2025-11-09 14:25:15 +00:00
Julian Pawlowski
165bbd4d88 docs(workflow): enhance copilot-instructions with detailed documentation update process
Expanded the documentation to include a comprehensive update process for maintaining consistency between code and documentation. Added sections on automatic inconsistency detection, documentation update proposals, and guidelines for testing changes and git workflow.

Impact: Ensures accurate documentation and streamlined workflows for future development sessions.
2025-11-09 12:49:41 +00:00
Julian Pawlowski
ac100216ee refactor: Update attribute naming and ordering for clarity and consistency 2025-11-08 16:50:55 +00:00
Julian Pawlowski
1db729ae16 update copilot instructions to prefer Home Assistant datetime utilities over standard library 2025-11-06 11:42:59 +00:00
Julian Pawlowski
c3b3cf82bd
Merge pull request #19 from jpawlowski/dependabot/github_actions/astral-sh/setup-uv-7.1.2
Bump astral-sh/setup-uv from 7.1.0 to 7.1.2
2025-11-03 23:12:15 +01:00
Julian Pawlowski
fbda6281d1 update copilot instructions 2025-11-03 21:49:15 +00:00
dependabot[bot]
3c8fa390d7
Bump astral-sh/setup-uv from 7.1.0 to 7.1.2
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 7.1.0 to 7.1.2.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](3259c6206f...85856786d1)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 7.1.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-03 20:42:25 +00:00
Julian Pawlowski
6040a19136 update dev environment 2025-11-03 15:54:01 +00:00
dependabot[bot]
99da067faa
Bump home-assistant/actions
Bumps [home-assistant/actions](https://github.com/home-assistant/actions) from a19f5f4e08ef2786e4604a948f62addd937a6bc9 to 8ca6e134c077479b26138bd33520707e8d94ef59.
- [Release notes](https://github.com/home-assistant/actions/releases)
- [Commits](a19f5f4e08...8ca6e134c0)

---
updated-dependencies:
- dependency-name: home-assistant/actions
  dependency-version: 8ca6e134c077479b26138bd33520707e8d94ef59
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-02 10:59:07 +00:00
Julian Pawlowski
ac196d4c34
Merge pull request #11 from jpawlowski/dependabot/github_actions/actions/setup-python-6.0.0
Bump actions/setup-python from 5.5.0 to 6.0.0
2025-11-02 11:58:28 +01:00
dependabot[bot]
2c526f57a1
Bump actions/setup-python from 5.5.0 to 6.0.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.5.0 to 6.0.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](8d9ed9ac5c...e797f83bcb)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 20:26:43 +00:00
dependabot[bot]
d256920b14
Bump actions/checkout from 4.2.2 to 5.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](11bd71901b...08c6903cd8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-13 01:46:22 +00:00
Julian Pawlowski
0a11f38a1b fix 2025-05-20 20:44:35 +00:00
Julian Pawlowski
f4a8d68937 fix 2025-05-20 20:26:33 +00:00
Julian Pawlowski
fe2bad218f update 2025-05-20 20:24:36 +00:00
Julian Pawlowski
ab48d56385 refactoring 2025-05-20 20:01:24 +00:00
Julian Pawlowski
990bf2e130 refactoring 2025-05-20 19:44:27 +00:00
Julian Pawlowski
f38db9097e update 2025-05-20 19:19:31 +00:00
Julian Pawlowski
39f426cd97 update 2025-05-20 18:53:22 +00:00
Julian Pawlowski
59cd48977b add copilot instructions 2025-04-23 17:46:12 +00:00
Julian Pawlowski
dea7cfee43 Rename component 2025-04-18 12:51:32 +00:00
Julian Pawlowski
131a4eb148
Initial commit 2025-04-18 14:32:54 +02:00