Skip to content

Commit

Permalink
Merge branch 'home-assistant:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
azerty9971 authored Aug 29, 2024
2 parents 15e6949 + 3d39f6c commit a59c935
Show file tree
Hide file tree
Showing 893 changed files with 22,277 additions and 6,744 deletions.
1 change: 1 addition & 0 deletions .core_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ components: &components
- homeassistant/components/auth/**
- homeassistant/components/automation/**
- homeassistant/components/backup/**
- homeassistant/components/blueprint/**
- homeassistant/components/bluetooth/**
- homeassistant/components/cloud/**
- homeassistant/components/config/**
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -482,3 +482,56 @@ jobs:
export TWINE_PASSWORD="${{ secrets.TWINE_TOKEN }}"
twine upload dist/* --skip-existing
hassfest-image:
name: Build and test hassfest image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
needs: ["init", "build_base"]
if: github.repository_owner == 'home-assistant'
env:
HASSFEST_IMAGE_NAME: ghcr.io/home-assistant/hassfest
HASSFEST_IMAGE_TAG: ghcr.io/home-assistant/hassfest:${{ needs.init.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Docker image
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: ./script/hassfest/docker
build-args: BASE_IMAGE=ghcr.io/home-assistant/amd64-homeassistant:${{ needs.init.outputs.version }}
load: true
tags: ${{ env.HASSFEST_IMAGE_TAG }}

- name: Run hassfest against core
run: docker run --rm -v ${{ github.workspace }}/homeassistant:/github/workspace/homeassistant ${{ env.HASSFEST_IMAGE_TAG }} --core-integrations-path=/github/workspace/homeassistant/components

- name: Push Docker image
if: needs.init.outputs.channel != 'dev' && needs.init.outputs.publish == 'true'
id: push
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: ./script/hassfest/docker
build-args: BASE_IMAGE=ghcr.io/home-assistant/amd64-homeassistant:${{ needs.init.outputs.version }}
push: true
tags: ${{ env.HASSFEST_IMAGE_TAG }},${{ env.HASSFEST_IMAGE_NAME }}:latest

- name: Generate artifact attestation
if: needs.init.outputs.channel != 'dev' && needs.init.outputs.publish == 'true'
uses: actions/attest-build-provenance@6149ea5740be74af77f260b9db67e633f6b0a9a1 # v1.4.2
with:
subject-name: ${{ env.HASSFEST_IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ env:
CACHE_VERSION: 10
UV_CACHE_VERSION: 1
MYPY_CACHE_VERSION: 8
HA_SHORT_VERSION: "2024.9"
HA_SHORT_VERSION: "2024.10"
DEFAULT_PYTHON: "3.12"
ALL_PYTHON_VERSIONS: "['3.12']"
# 10.3 is the oldest supported version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
uses: actions/checkout@v4.1.7

- name: Initialize CodeQL
uses: github/codeql-action/init@v3.26.4
uses: github/codeql-action/init@v3.26.5
with:
languages: python

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.26.4
uses: github/codeql-action/analyze@v3.26.5
with:
category: "/language:python"
2 changes: 1 addition & 1 deletion .strict-typing
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ homeassistant.components.cpuspeed.*
homeassistant.components.crownstone.*
homeassistant.components.date.*
homeassistant.components.datetime.*
homeassistant.components.deako.*
homeassistant.components.deconz.*
homeassistant.components.default_config.*
homeassistant.components.demo.*
Expand Down Expand Up @@ -294,7 +295,6 @@ homeassistant.components.london_underground.*
homeassistant.components.lookin.*
homeassistant.components.luftdaten.*
homeassistant.components.madvr.*
homeassistant.components.mailbox.*
homeassistant.components.manual.*
homeassistant.components.map.*
homeassistant.components.mastodon.*
Expand Down
6 changes: 6 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ build.json @home-assistant/supervisor
/tests/components/date/ @home-assistant/core
/homeassistant/components/datetime/ @home-assistant/core
/tests/components/datetime/ @home-assistant/core
/homeassistant/components/deako/ @sebirdman @balake @deakolights
/tests/components/deako/ @sebirdman @balake @deakolights
/homeassistant/components/debugpy/ @frenck
/tests/components/debugpy/ @frenck
/homeassistant/components/deconz/ @Kane610
Expand Down Expand Up @@ -1493,6 +1495,8 @@ build.json @home-assistant/supervisor
/tests/components/tomorrowio/ @raman325 @lymanepp
/homeassistant/components/totalconnect/ @austinmroczek
/tests/components/totalconnect/ @austinmroczek
/homeassistant/components/touchline_sl/ @jnsgruk
/tests/components/touchline_sl/ @jnsgruk
/homeassistant/components/tplink/ @rytilahti @bdraco @sdb9696
/tests/components/tplink/ @rytilahti @bdraco @sdb9696
/homeassistant/components/tplink_omada/ @MarkGodwin
Expand Down Expand Up @@ -1658,6 +1662,8 @@ build.json @home-assistant/supervisor
/tests/components/xiaomi_miio/ @rytilahti @syssi @starkillerOG
/homeassistant/components/xiaomi_tv/ @simse
/homeassistant/components/xmpp/ @fabaff @flowolf
/homeassistant/components/yale/ @bdraco
/tests/components/yale/ @bdraco
/homeassistant/components/yale_smart_alarm/ @gjohansson-ST
/tests/components/yale_smart_alarm/ @gjohansson-ST
/homeassistant/components/yalexs_ble/ @bdraco
Expand Down
5 changes: 5 additions & 0 deletions homeassistant/brands/roth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"domain": "roth",
"name": "Roth",
"integrations": ["touchline", "touchline_sl"]
}
8 changes: 7 additions & 1 deletion homeassistant/brands/yale.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"domain": "yale",
"name": "Yale",
"integrations": ["august", "yale_smart_alarm", "yalexs_ble", "yale_home"]
"integrations": [
"august",
"yale_smart_alarm",
"yalexs_ble",
"yale_home",
"yale"
]
}
12 changes: 9 additions & 3 deletions homeassistant/components/abode/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@
}
},
"services": {
"capture_image": "mdi:camera",
"change_setting": "mdi:cog",
"trigger_automation": "mdi:play"
"capture_image": {
"service": "mdi:camera"
},
"change_setting": {
"service": "mdi:cog"
},
"trigger_automation": {
"service": "mdi:play"
}
}
}
20 changes: 15 additions & 5 deletions homeassistant/components/adguard/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,20 @@
}
},
"services": {
"add_url": "mdi:link-plus",
"remove_url": "mdi:link-off",
"enable_url": "mdi:link-variant",
"disable_url": "mdi:link-variant-off",
"refresh": "mdi:refresh"
"add_url": {
"service": "mdi:link-plus"
},
"remove_url": {
"service": "mdi:link-off"
},
"enable_url": {
"service": "mdi:link-variant"
},
"disable_url": {
"service": "mdi:link-variant-off"
},
"refresh": {
"service": "mdi:refresh"
}
}
}
4 changes: 3 additions & 1 deletion homeassistant/components/ads/icons.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"services": {
"write_data_by_name": "mdi:pencil"
"write_data_by_name": {
"service": "mdi:pencil"
}
}
}
4 changes: 3 additions & 1 deletion homeassistant/components/advantage_air/icons.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"services": {
"set_time_to": "mdi:timer-cog"
"set_time_to": {
"service": "mdi:timer-cog"
}
}
}
8 changes: 6 additions & 2 deletions homeassistant/components/aftership/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
}
},
"services": {
"add_tracking": "mdi:package-variant-plus",
"remove_tracking": "mdi:package-variant-minus"
"add_tracking": {
"service": "mdi:package-variant-plus"
},
"remove_tracking": {
"service": "mdi:package-variant-minus"
}
}
}
20 changes: 15 additions & 5 deletions homeassistant/components/agent_dvr/icons.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
{
"services": {
"start_recording": "mdi:record-rec",
"stop_recording": "mdi:stop",
"enable_alerts": "mdi:bell-alert",
"disable_alerts": "mdi:bell-off",
"snapshot": "mdi:camera"
"start_recording": {
"service": "mdi:record-rec"
},
"stop_recording": {
"service": "mdi:stop"
},
"enable_alerts": {
"service": "mdi:bell-alert"
},
"disable_alerts": {
"service": "mdi:bell-off"
},
"snapshot": {
"service": "mdi:camera"
}
}
}
2 changes: 1 addition & 1 deletion homeassistant/components/airthings_ble/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
"dependencies": ["bluetooth_adapters"],
"documentation": "https://www.home-assistant.io/integrations/airthings_ble",
"iot_class": "local_polling",
"requirements": ["airthings-ble==0.9.0"]
"requirements": ["airthings-ble==0.9.1"]
}
8 changes: 3 additions & 5 deletions homeassistant/components/airvisual_pro/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ def __init__(self) -> None:
"""Initialize."""
self._reauth_entry: ConfigEntry | None = None

async def async_step_import(
self, import_config: dict[str, Any]
) -> ConfigFlowResult:
"""Import a config entry from configuration.yaml."""
return await self.async_step_user(import_config)
async def async_step_import(self, import_data: dict[str, Any]) -> ConfigFlowResult:
"""Import a config entry from `airvisual` integration (see #83882)."""
return await self.async_step_user(import_data)

async def async_step_reauth(
self, entry_data: Mapping[str, Any]
Expand Down
62 changes: 59 additions & 3 deletions homeassistant/components/airzone/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@

from __future__ import annotations

from collections.abc import Callable
from dataclasses import dataclass
from typing import Any, Final

from aioairzone.common import GrilleAngle, SleepTimeout
from aioairzone.common import GrilleAngle, OperationMode, SleepTimeout
from aioairzone.const import (
API_COLD_ANGLE,
API_HEAT_ANGLE,
API_MODE,
API_SLEEP,
AZD_COLD_ANGLE,
AZD_HEAT_ANGLE,
AZD_MASTER,
AZD_MODE,
AZD_MODES,
AZD_SLEEP,
AZD_ZONES,
)
Expand All @@ -33,6 +38,9 @@ class AirzoneSelectDescription(SelectEntityDescription):

api_param: str
options_dict: dict[str, int]
options_fn: Callable[[dict[str, Any], dict[str, int]], list[str]] = (
lambda zone_data, value: list(value)
)


GRILLE_ANGLE_DICT: Final[dict[str, int]] = {
Expand All @@ -42,6 +50,15 @@ class AirzoneSelectDescription(SelectEntityDescription):
"40deg": GrilleAngle.DEG_40,
}

MODE_DICT: Final[dict[str, int]] = {
"cool": OperationMode.COOLING,
"dry": OperationMode.DRY,
"fan": OperationMode.FAN,
"heat": OperationMode.HEATING,
"heat_cool": OperationMode.AUTO,
"stop": OperationMode.STOP,
}

SLEEP_DICT: Final[dict[str, int]] = {
"off": SleepTimeout.SLEEP_OFF,
"30m": SleepTimeout.SLEEP_30,
Expand All @@ -50,6 +67,26 @@ class AirzoneSelectDescription(SelectEntityDescription):
}


def main_zone_options(
zone_data: dict[str, Any],
options: dict[str, int],
) -> list[str]:
"""Filter available modes."""
modes = zone_data.get(AZD_MODES, [])
return [k for k, v in options.items() if v in modes]


MAIN_ZONE_SELECT_TYPES: Final[tuple[AirzoneSelectDescription, ...]] = (
AirzoneSelectDescription(
api_param=API_MODE,
key=AZD_MODE,
options_dict=MODE_DICT,
options_fn=main_zone_options,
translation_key="modes",
),
)


ZONE_SELECT_TYPES: Final[tuple[AirzoneSelectDescription, ...]] = (
AirzoneSelectDescription(
api_param=API_COLD_ANGLE,
Expand Down Expand Up @@ -95,7 +132,20 @@ def _async_entity_listener() -> None:
received_zones = set(zones_data)
new_zones = received_zones - added_zones
if new_zones:
async_add_entities(
entities: list[AirzoneZoneSelect] = [
AirzoneZoneSelect(
coordinator,
description,
entry,
system_zone_id,
zones_data.get(system_zone_id),
)
for system_zone_id in new_zones
for description in MAIN_ZONE_SELECT_TYPES
if description.key in zones_data.get(system_zone_id)
and zones_data.get(system_zone_id).get(AZD_MASTER) is True
]
entities += [
AirzoneZoneSelect(
coordinator,
description,
Expand All @@ -106,7 +156,8 @@ def _async_entity_listener() -> None:
for system_zone_id in new_zones
for description in ZONE_SELECT_TYPES
if description.key in zones_data.get(system_zone_id)
)
]
async_add_entities(entities)
added_zones.update(new_zones)

entry.async_on_unload(coordinator.async_add_listener(_async_entity_listener))
Expand Down Expand Up @@ -153,6 +204,11 @@ def __init__(
f"{self._attr_unique_id}_{system_zone_id}_{description.key}"
)
self.entity_description = description

self._attr_options = self.entity_description.options_fn(
zone_data, description.options_dict
)

self.values_dict = {v: k for k, v in description.options_dict.items()}

self._async_update_attrs()
Expand Down
Loading

0 comments on commit a59c935

Please sign in to comment.