Skip to content

Commit

Permalink
Merge branch 'feature/remove-rounding-from-zha-integration' of https:…
Browse files Browse the repository at this point in the history
…//github.com/Roeland54/core into feature/remove-rounding-from-zha-integration
  • Loading branch information
Roeland authored and Roeland committed Dec 20, 2023
2 parents 0f824ae + 1252098 commit 72efe0e
Show file tree
Hide file tree
Showing 578 changed files with 8,271 additions and 4,410 deletions.
3 changes: 2 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,8 @@ omit =
homeassistant/components/stream/hls.py
homeassistant/components/stream/worker.py
homeassistant/components/streamlabswater/*
homeassistant/components/suez_water/*
homeassistant/components/suez_water/__init__.py
homeassistant/components/suez_water/sensor.py
homeassistant/components/supervisord/sensor.py
homeassistant/components/supla/*
homeassistant/components/surepetcare/__init__.py
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build base image
uses: home-assistant/builder@2023.09.0
uses: home-assistant/builder@2023.12.0
with:
args: |
$BUILD_ARGS \
Expand Down Expand Up @@ -247,6 +247,7 @@ jobs:
- raspberrypi3-64
- raspberrypi4
- raspberrypi4-64
- raspberrypi5-64
- tinker
- yellow
- green
Expand All @@ -273,7 +274,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build base image
uses: home-assistant/builder@2023.09.0
uses: home-assistant/builder@2023.12.0
with:
args: |
$BUILD_ARGS \
Expand Down Expand Up @@ -330,7 +331,7 @@ jobs:
uses: actions/[email protected]

- name: Install Cosign
uses: sigstore/cosign-installer@v3.2.0
uses: sigstore/cosign-installer@v3.3.0
with:
cosign-release: "v2.0.2"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
uses: actions/[email protected]

- name: Initialize CodeQL
uses: github/codeql-action/[email protected].9
uses: github/codeql-action/[email protected].10
with:
languages: python

- name: Perform CodeQL Analysis
uses: github/codeql-action/[email protected].9
uses: github/codeql-action/[email protected].10
with:
category: "/language:python"
6 changes: 6 additions & 0 deletions .strict-typing
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ homeassistant.components.abode.*
homeassistant.components.accuweather.*
homeassistant.components.acer_projector.*
homeassistant.components.actiontec.*
homeassistant.components.adax.*
homeassistant.components.adguard.*
homeassistant.components.aftership.*
homeassistant.components.air_quality.*
homeassistant.components.airly.*
homeassistant.components.airvisual.*
homeassistant.components.airvisual_pro.*
homeassistant.components.airzone.*
homeassistant.components.airzone_cloud.*
homeassistant.components.aladdin_connect.*
Expand All @@ -59,10 +61,13 @@ homeassistant.components.ambient_station.*
homeassistant.components.amcrest.*
homeassistant.components.ampio.*
homeassistant.components.analytics.*
homeassistant.components.android_ip_webcam.*
homeassistant.components.anova.*
homeassistant.components.anthemav.*
homeassistant.components.apcupsd.*
homeassistant.components.apprise.*
homeassistant.components.aqualogic.*
homeassistant.components.aranet.*
homeassistant.components.aseko_pool_live.*
homeassistant.components.assist_pipeline.*
homeassistant.components.asuswrt.*
Expand Down Expand Up @@ -318,6 +323,7 @@ homeassistant.components.steamist.*
homeassistant.components.stookalert.*
homeassistant.components.stream.*
homeassistant.components.streamlabswater.*
homeassistant.components.suez_water.*
homeassistant.components.sun.*
homeassistant.components.surepetcare.*
homeassistant.components.switch.*
Expand Down
3 changes: 3 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,7 @@ build.json @home-assistant/supervisor
/homeassistant/components/subaru/ @G-Two
/tests/components/subaru/ @G-Two
/homeassistant/components/suez_water/ @ooii
/tests/components/suez_water/ @ooii
/homeassistant/components/sun/ @Swamp-Ig
/tests/components/sun/ @Swamp-Ig
/homeassistant/components/sunweg/ @rokam
Expand Down Expand Up @@ -1303,6 +1304,8 @@ build.json @home-assistant/supervisor
/tests/components/template/ @PhracturedBlue @tetienne @home-assistant/core
/homeassistant/components/tesla_wall_connector/ @einarhauks
/tests/components/tesla_wall_connector/ @einarhauks
/homeassistant/components/tessie/ @Bre77
/tests/components/tessie/ @Bre77
/homeassistant/components/text/ @home-assistant/core
/tests/components/text/ @home-assistant/core
/homeassistant/components/tfiac/ @fredrike @mellado
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/adax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
# convert title and unique_id to string
if config_entry.version == 1:
if isinstance(config_entry.unique_id, int):
hass.config_entries.async_update_entry(
hass.config_entries.async_update_entry( # type: ignore[unreachable]
config_entry,
unique_id=str(config_entry.unique_id),
title=str(config_entry.title),
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/adax/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class LocalAdaxDevice(ClimateEntity):
_attr_target_temperature_step = PRECISION_WHOLE
_attr_temperature_unit = UnitOfTemperature.CELSIUS

def __init__(self, adax_data_handler, unique_id):
def __init__(self, adax_data_handler: AdaxLocal, unique_id: str) -> None:
"""Initialize the heater."""
self._adax_data_handler = adax_data_handler
self._attr_unique_id = unique_id
Expand Down
8 changes: 6 additions & 2 deletions homeassistant/components/adax/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):

VERSION = 2

async def async_step_user(self, user_input=None):
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
"""Handle the initial step."""
data_schema = vol.Schema(
{
Expand All @@ -59,7 +61,9 @@ async def async_step_user(self, user_input=None):
return await self.async_step_local()
return await self.async_step_cloud()

async def async_step_local(self, user_input=None):
async def async_step_local(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
"""Handle the local step."""
data_schema = vol.Schema(
{vol.Required(WIFI_SSID): str, vol.Required(WIFI_PSWD): str}
Expand Down
23 changes: 3 additions & 20 deletions homeassistant/components/aftership/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from homeassistant.config_entries import ConfigFlow
from homeassistant.const import CONF_API_KEY, CONF_NAME
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN
from homeassistant.data_entry_flow import AbortFlow, FlowResult
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue

Expand Down Expand Up @@ -51,25 +51,6 @@ async def async_step_user(

async def async_step_import(self, config: dict[str, Any]) -> FlowResult:
"""Import configuration from yaml."""
try:
self._async_abort_entries_match({CONF_API_KEY: config[CONF_API_KEY]})
except AbortFlow as err:
async_create_issue(
self.hass,
DOMAIN,
"deprecated_yaml_import_issue_already_configured",
breaks_in_ha_version="2024.4.0",
is_fixable=False,
issue_domain=DOMAIN,
severity=IssueSeverity.WARNING,
translation_key="deprecated_yaml_import_issue_already_configured",
translation_placeholders={
"domain": DOMAIN,
"integration_title": "AfterShip",
},
)
raise err

async_create_issue(
self.hass,
HOMEASSISTANT_DOMAIN,
Expand All @@ -84,6 +65,8 @@ async def async_step_import(self, config: dict[str, Any]) -> FlowResult:
"integration_title": "AfterShip",
},
)

self._async_abort_entries_match({CONF_API_KEY: config[CONF_API_KEY]})
return self.async_create_entry(
title=config.get(CONF_NAME, "AfterShip"),
data={CONF_API_KEY: config[CONF_API_KEY]},
Expand Down
4 changes: 0 additions & 4 deletions homeassistant/components/aftership/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@
}
},
"issues": {
"deprecated_yaml_import_issue_already_configured": {
"title": "The {integration_title} YAML configuration import failed",
"description": "Configuring {integration_title} using YAML is being removed but the YAML configuration was already imported.\n\nRemove the YAML configuration and restart Home Assistant."
},
"deprecated_yaml_import_issue_cannot_connect": {
"title": "The {integration_title} YAML configuration import failed",
"description": "Configuring {integration_title} using YAML is being removed but there was an connection error importing your YAML configuration.\n\nEnsure connection to {integration_title} works and restart Home Assistant to try again or remove the {integration_title} YAML configuration from your configuration.yaml file and continue to [set up the integration]({url}) manually."
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/airthings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from airthings import Airthings, AirthingsError

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.const import CONF_ID, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed

from .const import CONF_ID, CONF_SECRET, DOMAIN
from .const import CONF_SECRET, DOMAIN

_LOGGER = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/airthings/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
import voluptuous as vol

from homeassistant import config_entries
from homeassistant.const import CONF_ID
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers.aiohttp_client import async_get_clientsession

from .const import CONF_ID, CONF_SECRET, DOMAIN
from .const import CONF_SECRET, DOMAIN

_LOGGER = logging.getLogger(__name__)

Expand Down
1 change: 0 additions & 1 deletion homeassistant/components/airthings/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

DOMAIN = "airthings"

CONF_ID = "id"
CONF_SECRET = "secret"
8 changes: 6 additions & 2 deletions homeassistant/components/airthings_ble/sensor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Support for airthings ble sensors."""
from __future__ import annotations

import dataclasses
import logging

from airthings_ble import AirthingsDevice
Expand Down Expand Up @@ -167,10 +168,13 @@ async def async_setup_entry(
# we need to change some units
sensors_mapping = SENSORS_MAPPING_TEMPLATE.copy()
if not is_metric:
for val in sensors_mapping.values():
for key, val in sensors_mapping.items():
if val.native_unit_of_measurement is not VOLUME_BECQUEREL:
continue
val.native_unit_of_measurement = VOLUME_PICOCURIE
sensors_mapping[key] = dataclasses.replace(
val,
native_unit_of_measurement=VOLUME_PICOCURIE,
)

entities = []
_LOGGER.debug("got sensors: %s", coordinator.data.sensors)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/airvisual/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import (
CONF_API_KEY,
CONF_COUNTRY,
CONF_IP_ADDRESS,
CONF_LATITUDE,
CONF_LONGITUDE,
Expand All @@ -44,7 +45,6 @@

from .const import (
CONF_CITY,
CONF_COUNTRY,
CONF_GEOGRAPHIES,
CONF_INTEGRATION_TYPE,
DOMAIN,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/airvisual/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_API_KEY,
CONF_COUNTRY,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_SHOW_ON_MAP,
Expand All @@ -35,7 +36,6 @@
from . import async_get_geography_id
from .const import (
CONF_CITY,
CONF_COUNTRY,
CONF_INTEGRATION_TYPE,
DOMAIN,
INTEGRATION_TYPE_GEOGRAPHY_COORDS,
Expand Down
1 change: 0 additions & 1 deletion homeassistant/components/airvisual/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
INTEGRATION_TYPE_NODE_PRO = "AirVisual Node/Pro"

CONF_CITY = "city"
CONF_COUNTRY = "country"
CONF_GEOGRAPHIES = "geographies"
CONF_INTEGRATION_TYPE = "integration_type"
3 changes: 2 additions & 1 deletion homeassistant/components/airvisual/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_API_KEY,
CONF_COUNTRY,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_STATE,
Expand All @@ -15,7 +16,7 @@
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator

from .const import CONF_CITY, CONF_COUNTRY, DOMAIN
from .const import CONF_CITY, DOMAIN

CONF_COORDINATES = "coordinates"
CONF_TITLE = "title"
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/airvisual/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_BILLION,
CONCENTRATION_PARTS_PER_MILLION,
CONF_COUNTRY,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_SHOW_ON_MAP,
Expand All @@ -25,7 +26,7 @@
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator

from . import AirVisualEntity
from .const import CONF_CITY, CONF_COUNTRY, DOMAIN
from .const import CONF_CITY, DOMAIN

ATTR_CITY = "city"
ATTR_COUNTRY = "country"
Expand Down
11 changes: 10 additions & 1 deletion homeassistant/components/alexa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
CONF_SMART_HOME = "smart_home"
DEFAULT_LOCALE = "en-US"

# Alexa Smart Home API send events gateway endpoints
# https://developer.amazon.com/en-US/docs/alexa/smarthome/send-events.html#endpoints
VALID_ENDPOINTS = [
"https://api.amazonalexa.com/v3/events",
"https://api.eu.amazonalexa.com/v3/events",
"https://api.fe.amazonalexa.com/v3/events",
]


ALEXA_ENTITY_SCHEMA = vol.Schema(
{
vol.Optional(CONF_DESCRIPTION): cv.string,
Expand All @@ -46,7 +55,7 @@

SMART_HOME_SCHEMA = vol.Schema(
{
vol.Optional(CONF_ENDPOINT): cv.string,
vol.Optional(CONF_ENDPOINT): vol.All(vol.Lower, vol.In(VALID_ENDPOINTS)),
vol.Optional(CONF_CLIENT_ID): cv.string,
vol.Optional(CONF_CLIENT_SECRET): cv.string,
vol.Optional(CONF_LOCALE, default=DEFAULT_LOCALE): vol.In(
Expand Down
Loading

0 comments on commit 72efe0e

Please sign in to comment.