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
9 changes: 6 additions & 3 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: ✅ CI Pipeline

on:
push:
branches: [dev]
pull_request:
branches: [main]
branches: [dev, main]
schedule:
- cron: "0 3 * * 1" # Läuft jeden Montag um 03:00 UTC für automatische Updates

concurrency:
# Bei Push: "CI-push-dev", bei PR zu main: "CI-pr-123"
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.ref_name || github.event.pull_request.number }}
cancel-in-progress: true

jobs:
lint:
name: "🔍 Linting & Static Analysis"
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/hacs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: HACS Quality Checks

on:
push:
branches: [dev]
pull_request:
branches: [main]
branches: [dev, main]
schedule:
- cron: "0 0 * * *"

concurrency:
# Bei Push: "HACS-push-dev", bei PR zu main: "HACS-pr-123"
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.ref_name || github.event.pull_request.number }}
cancel-in-progress: true

jobs:
hacs:
name: HACS
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/hass.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: Home Assistant Quality Checks

on:
push:
branches: [dev]
pull_request:
branches: [main]
branches: [dev, main]
schedule:
- cron: "0 0 * * *"

concurrency:
# Bei Push: "HASS-push-dev", bei PR zu main: "HASS-pr-123"
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.ref_name || github.event.pull_request.number }}
cancel-in-progress: true

jobs:
hass:
name: HASS
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Tests

on:
push:
branches: [main, master, dev]
pull_request:
branches: [main, master]
branches: [dev, main]

concurrency:
# Bei Push: "Tests-push-main", bei PR zu main: "Tests-pr-123"
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.ref_name || github.event.pull_request.number }}
cancel-in-progress: true

jobs:
test:
Expand Down
9 changes: 8 additions & 1 deletion custom_components/diveracontrol/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from .const import (
D_API_KEY,
D_BASE_API_URL,
D_CLUSTER_NAME,
D_COORDINATOR,
D_INTEGRATION_VERSION,
Expand Down Expand Up @@ -53,6 +54,7 @@ async def async_setup_entry(
ucr_id: str = config_entry.data.get(D_UCR_ID) or ""
cluster_name: str = config_entry.data.get(D_CLUSTER_NAME) or ""
api_key: str = config_entry.data.get(D_API_KEY) or ""
base_url: str = config_entry.data.get(D_BASE_API_URL) or ""
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base URL extraction uses or \"\" which will result in an empty string if D_BASE_API_URL is not in config_entry.data (e.g., for existing installations upgrading to this version). This will cause API requests to fail. Consider providing a fallback to BASE_API_URL constant: base_url: str = config_entry.data.get(D_BASE_API_URL, BASE_API_URL)

Copilot uses AI. Check for mistakes.

_LOGGER.debug("Setting up cluster: %s (%s)", cluster_name, ucr_id)

Expand All @@ -61,6 +63,7 @@ async def async_setup_entry(
hass,
ucr_id,
api_key,
base_url,
)
coordinator = DiveraCoordinator(
hass,
Expand Down Expand Up @@ -126,7 +129,8 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
"""

# changing to v1.2.0
if VERSION == 1 and MINOR_VERSION == 2:
# all versions before 1.2.0 do not have PATCH_VERSION set
if VERSION == 1 and MINOR_VERSION == 2 and not PATCH_VERSION:
_LOGGER.info(
"Migrating config entry to version %s.%s.%s",
VERSION,
Expand Down Expand Up @@ -182,4 +186,7 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
_LOGGER.exception(
"Failed to remove old entity registry entries during migration"
)

# v1.2.1: no migration needed

return True
Loading
Loading