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
44 changes: 27 additions & 17 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ env:
# Base image version from https://github.com/home-assistant/docker
BASE_IMAGE_VERSION: "2026.07.0"
ARCHITECTURES: '["amd64", "aarch64"]'
MACHINES: >-
["generic-x86-64", "khadas-vim3", "odroid-c2", "odroid-c4", "odroid-m1",
"odroid-n2", "qemuarm-64", "qemux86-64", "raspberrypi3-64",
"raspberrypi4-64", "raspberrypi5-64", "yellow", "green"]

permissions: {}

Expand All @@ -35,6 +39,7 @@ jobs:
channel: ${{ steps.version.outputs.channel }}
publish: ${{ steps.version.outputs.publish }}
architectures: ${{ env.ARCHITECTURES }}
machines: ${{ env.MACHINES }}
base_image_version: ${{ env.BASE_IMAGE_VERSION }}
steps:
- name: Checkout the repository
Expand Down Expand Up @@ -218,20 +223,7 @@ jobs:
id-token: write # For cosign signing
strategy:
matrix:
machine:
- generic-x86-64
- khadas-vim3
- odroid-c2
- odroid-c4
- odroid-m1
- odroid-n2
- qemuarm-64
- qemux86-64
- raspberrypi3-64
- raspberrypi4-64
- raspberrypi5-64
- yellow
- green
machine: ${{ fromJson(needs.init.outputs.machines) }}
include:
# Default: aarch64 on native ARM runner
- arch: aarch64
Expand Down Expand Up @@ -282,11 +274,29 @@ jobs:
push: true
version: ${{ needs.init.outputs.version }}

run_e2e_tests_base:
name: Run E2E tests on base images
if: github.repository_owner == 'home-assistant'
needs: ["init", "build_base"]
uses: ./.github/workflows/e2e-tests.yml
with:
version: ${{ needs.init.outputs.version }}
image_prefixes: ${{ needs.init.outputs.architectures }}

run_e2e_tests_machine:
name: Run E2E tests on machine images
if: github.repository_owner == 'home-assistant'
needs: ["init", "build_machine"]
uses: ./.github/workflows/e2e-tests.yml
with:
version: ${{ needs.init.outputs.version }}
image_prefixes: ${{ needs.init.outputs.machines }}

publish_ha:
name: Publish version files
environment: ${{ needs.init.outputs.channel }}
if: github.repository_owner == 'home-assistant'
needs: ["init", "build_machine"]
needs: ["init", "build_machine", "run_e2e_tests_machine"]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -326,7 +336,7 @@ jobs:
name: Publish to ${{ matrix.registry }}
environment: ${{ needs.init.outputs.channel }}
if: github.repository_owner == 'home-assistant'
needs: ["init", "build_base"]
needs: ["init", "build_base", "run_e2e_tests_base"]
runs-on: ubuntu-latest
permissions:
contents: read # To check out the repository
Expand Down Expand Up @@ -461,7 +471,7 @@ jobs:
build_python:
name: Build PyPi package
environment: ${{ needs.init.outputs.channel }}
needs: ["init", "build_base"]
needs: ["init", "build_base", "run_e2e_tests_base"]
runs-on: ubuntu-latest
permissions:
contents: read # To check out the repository
Expand Down
38 changes: 27 additions & 11 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,48 @@ on:
description: "Image tag or digest to test (e.g. dev, 2026.7.1, 2026.8.0b0, sha256:0a1b2c3d…)"
default: "dev"
required: true
image_prefixes:
description: "JSON array of image prefixes to test. Will be prefixed to `-homeassistant`"
default: >-
["generic-x86-64", "khadas-vim3", "odroid-c2", "odroid-c4",
"odroid-m1", "odroid-n2", "qemuarm-64", "qemux86-64",
"raspberrypi3-64", "raspberrypi4-64", "raspberrypi5-64",
"yellow", "green"]
required: true
workflow_call:
inputs:
version:
description: "Image tag or digest to test (e.g. dev, 2026.7.1, 2026.8.0b0, sha256:0a1b2c3d…)"
required: true
type: string
image_prefixes:
description: "JSON array of image prefixes to test. Will be prefixed to `-homeassistant`"
required: true
type: string

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.version }}
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.version }}-${{ inputs.image_prefixes }}
cancel-in-progress: true

jobs:
boot_check:
name: Boot check ${{ matrix.arch }} core image
name: Boot check ${{ matrix.image_prefix }} image
if: github.repository_owner == 'home-assistant'
runs-on: ${{ matrix.runs-on }}
# amd64 images need an x86 runner; all others are aarch64
runs-on: ${{ contains(fromJson('["amd64", "generic-x86-64", "qemux86-64"]'), matrix.image_prefix) && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
runs-on: ubuntu-24.04
- arch: aarch64
runs-on: ubuntu-24.04-arm
image_prefix: ${{ fromJson(inputs.image_prefixes) }}
env:
BASE_URL: http://localhost:8123
services:
homeassistant:
image: ghcr.io/home-assistant/home-assistant${{ startsWith(inputs.version, 'sha256:') && '@' || ':' }}${{ inputs.version }} # zizmor: ignore[unpinned-images]
# Digests are referenced with '@', tags with ':'
image: ghcr.io/home-assistant/${{ matrix.image_prefix }}-homeassistant${{ startsWith(inputs.version, 'sha256:') && '@' || ':' }}${{ inputs.version }} # zizmor: ignore[unpinned-images]
ports:
- 8123:8123
# Gate steps until Home Assistant answers (60 x 5s ≈ 300s startup budget)
Expand Down Expand Up @@ -76,7 +92,7 @@ jobs:
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-report-${{ matrix.arch }}
name: playwright-report-${{ matrix.image_prefix }}
path: |
tests/e2e/playwright-report/
tests/e2e/test-results/
Expand All @@ -91,5 +107,5 @@ jobs:
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: container-logs-${{ matrix.arch }}
name: container-logs-${{ matrix.image_prefix }}
path: homeassistant.log
3 changes: 3 additions & 0 deletions homeassistant/components/blebox/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"fav": ButtonEntityDescription(key="fav", translation_key="fav"),
"open": ButtonEntityDescription(key="open", translation_key="open"),
"close": ButtonEntityDescription(key="close", translation_key="close"),
"second_output": ButtonEntityDescription(
key="second_output", translation_key="second_output"
),
}

_DEFAULT_BUTTON = ButtonEntityDescription(key="button")
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/blebox/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"down": { "name": "Down" },
"fav": { "name": "Favorite" },
"open": { "name": "Open" },
"second_output": { "name": "Second output" },
"up": { "name": "Up" }
},
"light": { "channel": { "name": "Channel {index}" } },
Expand Down
28 changes: 27 additions & 1 deletion homeassistant/components/portainer/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from datetime import timedelta
from typing import Any, override

from pyportainer import Portainer
from pyportainer import DockerContainerState, Portainer
from pyportainer.exceptions import (
PortainerAuthenticationError,
PortainerConnectionError,
Expand Down Expand Up @@ -54,6 +54,7 @@ class PortainerContainerButtonDescription(ButtonEntityDescription):
[Portainer, int, str],
Coroutine[Any, Any, DockerContainer | None],
]
available_fn: Callable[[PortainerContainerData], bool]


ENDPOINT_BUTTONS: tuple[PortainerEndpointButtonDescription, ...] = (
Expand Down Expand Up @@ -89,6 +90,9 @@ class PortainerContainerButtonDescription(ButtonEntityDescription):
endpoint_id, container_id
)
),
available_fn=lambda container: (
container.container.state != DockerContainerState.PAUSED
),
),
PortainerContainerButtonDescription(
key="pause",
Expand All @@ -99,6 +103,9 @@ class PortainerContainerButtonDescription(ButtonEntityDescription):
endpoint_id, container_id
)
),
available_fn=lambda container: (
container.container.state == DockerContainerState.RUNNING
),
),
PortainerContainerButtonDescription(
key="resume",
Expand All @@ -109,6 +116,9 @@ class PortainerContainerButtonDescription(ButtonEntityDescription):
endpoint_id, container_id
)
),
available_fn=lambda container: (
container.container.state == DockerContainerState.PAUSED
),
),
PortainerContainerButtonDescription(
key="recreate",
Expand All @@ -122,6 +132,10 @@ class PortainerContainerButtonDescription(ButtonEntityDescription):
pull_image=True,
)
),
available_fn=lambda container: (
container.container.state
not in (DockerContainerState.REMOVING, DockerContainerState.DEAD)
),
),
PortainerContainerButtonDescription(
key="kill",
Expand All @@ -132,6 +146,10 @@ class PortainerContainerButtonDescription(ButtonEntityDescription):
endpoint_id, container_id
)
),
available_fn=lambda container: (
container.container.state
in (DockerContainerState.RUNNING, DockerContainerState.PAUSED)
),
),
)

Expand Down Expand Up @@ -244,6 +262,14 @@ class PortainerContainerButton(PortainerContainerEntity, PortainerBaseButton):

entity_description: PortainerContainerButtonDescription

@property
@override
def available(self) -> bool:
"""Return if the button is available."""
return super().available and self.entity_description.available_fn(
self.container_data
)

@override
async def _async_press_call(self) -> None:
"""Call the container button press action."""
Expand Down
Loading
Loading