Skip to content

Commit

Permalink
2024.6.2 (#119376)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Jun 11, 2024
2 parents b28cdcf + 415bfb4 commit 090d296
Show file tree
Hide file tree
Showing 109 changed files with 1,052 additions and 323 deletions.
1 change: 0 additions & 1 deletion .strict-typing
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ homeassistant.components.easyenergy.*
homeassistant.components.ecovacs.*
homeassistant.components.ecowitt.*
homeassistant.components.efergy.*
homeassistant.components.electrasmart.*
homeassistant.components.electric_kiwi.*
homeassistant.components.elgato.*
homeassistant.components.elkm1.*
Expand Down
2 changes: 0 additions & 2 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -1486,8 +1486,6 @@ build.json @home-assistant/supervisor
/tests/components/unifi/ @Kane610
/homeassistant/components/unifi_direct/ @tofuSCHNITZEL
/homeassistant/components/unifiled/ @florisvdk
/homeassistant/components/unifiprotect/ @bdraco
/tests/components/unifiprotect/ @bdraco
/homeassistant/components/upb/ @gwww
/tests/components/upb/ @gwww
/homeassistant/components/upc_connect/ @pvizeli @fabaff
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/aladdin_connect/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

DOMAIN = "aladdin_connect"

OAUTH2_AUTHORIZE = "https://app.aladdinconnect.com/login.html"
OAUTH2_AUTHORIZE = "https://app.aladdinconnect.net/login.html"
OAUTH2_TOKEN = "https://twdvzuefzh.execute-api.us-east-2.amazonaws.com/v1/oauth2/token"
9 changes: 4 additions & 5 deletions homeassistant/components/azure_data_explorer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,12 @@ async def async_setup(hass: HomeAssistant, yaml_config: ConfigType) -> bool:
Adds an empty filter to hass data.
Tries to get a filter from yaml, if present set to hass data.
If config is empty after getting the filter, return, otherwise emit
deprecated warning and pass the rest to the config flow.
"""

hass.data.setdefault(DOMAIN, {DATA_FILTER: {}})
hass.data.setdefault(DOMAIN, {DATA_FILTER: FILTER_SCHEMA({})})
if DOMAIN in yaml_config:
hass.data[DOMAIN][DATA_FILTER] = yaml_config[DOMAIN][CONF_FILTER]
hass.data[DOMAIN][DATA_FILTER] = yaml_config[DOMAIN].pop(CONF_FILTER)

return True


Expand Down Expand Up @@ -207,6 +206,6 @@ def _parse_event(
if "\n" in state.state:
return None, dropped + 1

json_event = str(json.dumps(obj=state, cls=JSONEncoder).encode("utf-8"))
json_event = json.dumps(obj=state, cls=JSONEncoder)

return (json_event, dropped)
37 changes: 24 additions & 13 deletions homeassistant/components/azure_data_explorer/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
CONF_APP_REG_ID,
CONF_APP_REG_SECRET,
CONF_AUTHORITY_ID,
CONF_USE_FREE,
CONF_USE_QUEUED_CLIENT,
)

_LOGGER = logging.getLogger(__name__)
Expand All @@ -35,7 +35,6 @@ class AzureDataExplorerClient:
def __init__(self, data: Mapping[str, Any]) -> None:
"""Create the right class."""

self._cluster_ingest_uri = data[CONF_ADX_CLUSTER_INGEST_URI]
self._database = data[CONF_ADX_DATABASE_NAME]
self._table = data[CONF_ADX_TABLE_NAME]
self._ingestion_properties = IngestionProperties(
Expand All @@ -45,24 +44,36 @@ def __init__(self, data: Mapping[str, Any]) -> None:
ingestion_mapping_reference="ha_json_mapping",
)

# Create cLient for ingesting and querying data
kcsb = KustoConnectionStringBuilder.with_aad_application_key_authentication(
self._cluster_ingest_uri,
data[CONF_APP_REG_ID],
data[CONF_APP_REG_SECRET],
data[CONF_AUTHORITY_ID],
# Create client for ingesting data
kcsb_ingest = (
KustoConnectionStringBuilder.with_aad_application_key_authentication(
data[CONF_ADX_CLUSTER_INGEST_URI],
data[CONF_APP_REG_ID],
data[CONF_APP_REG_SECRET],
data[CONF_AUTHORITY_ID],
)
)

if data[CONF_USE_FREE] is True:
# Create client for querying data
kcsb_query = (
KustoConnectionStringBuilder.with_aad_application_key_authentication(
data[CONF_ADX_CLUSTER_INGEST_URI].replace("ingest-", ""),
data[CONF_APP_REG_ID],
data[CONF_APP_REG_SECRET],
data[CONF_AUTHORITY_ID],
)
)

if data[CONF_USE_QUEUED_CLIENT] is True:
# Queded is the only option supported on free tear of ADX
self.write_client = QueuedIngestClient(kcsb)
self.write_client = QueuedIngestClient(kcsb_ingest)
else:
self.write_client = ManagedStreamingIngestClient.from_dm_kcsb(kcsb)
self.write_client = ManagedStreamingIngestClient.from_dm_kcsb(kcsb_ingest)

self.query_client = KustoClient(kcsb)
self.query_client = KustoClient(kcsb_query)

def test_connection(self) -> None:
"""Test connection, will throw Exception when it cannot connect."""
"""Test connection, will throw Exception if it cannot connect."""

query = f"{self._table} | take 1"

Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/azure_data_explorer/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from homeassistant import config_entries
from homeassistant.config_entries import ConfigFlowResult
from homeassistant.helpers.selector import BooleanSelector

from . import AzureDataExplorerClient
from .const import (
Expand All @@ -19,7 +20,7 @@
CONF_APP_REG_ID,
CONF_APP_REG_SECRET,
CONF_AUTHORITY_ID,
CONF_USE_FREE,
CONF_USE_QUEUED_CLIENT,
DEFAULT_OPTIONS,
DOMAIN,
)
Expand All @@ -34,7 +35,7 @@
vol.Required(CONF_APP_REG_ID): str,
vol.Required(CONF_APP_REG_SECRET): str,
vol.Required(CONF_AUTHORITY_ID): str,
vol.Optional(CONF_USE_FREE, default=False): bool,
vol.Required(CONF_USE_QUEUED_CLIENT, default=False): BooleanSelector(),
}
)

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/azure_data_explorer/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
CONF_SEND_INTERVAL = "send_interval"
CONF_MAX_DELAY = "max_delay"
CONF_FILTER = DATA_FILTER = "filter"
CONF_USE_FREE = "use_queued_ingestion"
CONF_USE_QUEUED_CLIENT = "use_queued_ingestion"
DATA_HUB = "hub"
STEP_USER = "user"

Expand Down
14 changes: 9 additions & 5 deletions homeassistant/components/azure_data_explorer/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
"step": {
"user": {
"title": "Setup your Azure Data Explorer integration",
"description": "Enter connection details.",
"description": "Enter connection details",
"data": {
"cluster_ingest_uri": "Cluster ingest URI",
"database": "Database name",
"table": "Table name",
"cluster_ingest_uri": "Cluster Ingest URI",
"authority_id": "Authority ID",
"client_id": "Client ID",
"client_secret": "Client secret",
"authority_id": "Authority ID",
"database": "Database name",
"table": "Table name",
"use_queued_ingestion": "Use queued ingestion"
},
"data_description": {
"cluster_ingest_uri": "Ingest-URI of the cluster",
"use_queued_ingestion": "Must be enabled when using ADX free cluster"
}
}
},
Expand Down
7 changes: 6 additions & 1 deletion homeassistant/components/control4/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
director_all_items = json.loads(director_all_items)
entry_data[CONF_DIRECTOR_ALL_ITEMS] = director_all_items

entry_data[CONF_UI_CONFIGURATION] = json.loads(await director.getUiConfiguration())
# Check if OS version is 3 or higher to get UI configuration
entry_data[CONF_UI_CONFIGURATION] = None
if int(entry_data[CONF_DIRECTOR_SW_VERSION].split(".")[0]) >= 3:
entry_data[CONF_UI_CONFIGURATION] = json.loads(
await director.getUiConfiguration()
)

# Load options from config entry
entry_data[CONF_SCAN_INTERVAL] = entry.options.get(
Expand Down
11 changes: 8 additions & 3 deletions homeassistant/components/control4/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,18 @@ async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Set up Control4 rooms from a config entry."""
entry_data = hass.data[DOMAIN][entry.entry_id]
ui_config = entry_data[CONF_UI_CONFIGURATION]

# OS 2 will not have a ui_configuration
if not ui_config:
_LOGGER.debug("No UI Configuration found for Control4")
return

all_rooms = await get_rooms(hass, entry)
if not all_rooms:
return

entry_data = hass.data[DOMAIN][entry.entry_id]
scan_interval = entry_data[CONF_SCAN_INTERVAL]
_LOGGER.debug("Scan interval = %s", scan_interval)

Expand Down Expand Up @@ -119,8 +126,6 @@ async def async_update_data() -> dict[int, dict[str, Any]]:
if "parentId" in item and k > 1
}

ui_config = entry_data[CONF_UI_CONFIGURATION]

entity_list = []
for room in all_rooms:
room_id = room["id"]
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/electrasmart/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/electrasmart",
"iot_class": "cloud_polling",
"requirements": ["pyElectra==1.2.0"]
"requirements": ["pyElectra==1.2.1"]
}
10 changes: 9 additions & 1 deletion homeassistant/components/elgato/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@ def __init__(self, coordinator: ElgatoDataUpdateCoordinator) -> None:
self._attr_unique_id = coordinator.data.info.serial_number

# Elgato Light supporting color, have a different temperature range
if self.coordinator.data.settings.power_on_hue is not None:
if (
self.coordinator.data.info.product_name
in (
"Elgato Light Strip",
"Elgato Light Strip Pro",
)
or self.coordinator.data.settings.power_on_hue
or self.coordinator.data.state.hue is not None
):
self._attr_supported_color_modes = {ColorMode.COLOR_TEMP, ColorMode.HS}
self._attr_min_mireds = 153
self._attr_max_mireds = 285
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/enigma2/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ def __init__(
self._device: OpenWebIfDevice = device
self._entry = entry

self._attr_unique_id = device.mac_address
self._attr_unique_id = device.mac_address or entry.entry_id

self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, device.mac_address)},
identifiers={(DOMAIN, self._attr_unique_id)},
manufacturer=about["info"]["brand"],
model=about["info"]["model"],
configuration_url=device.base,
Expand Down
39 changes: 6 additions & 33 deletions homeassistant/components/envisalink/alarm_control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ def __init__(
):
"""Initialize the alarm panel."""
self._partition_number = partition_number
self._code = code
self._panic_type = panic_type
self._alarm_control_panel_option_default_code = code
self._attr_code_format = CodeFormat.NUMBER

_LOGGER.debug("Setting up alarm: %s", alarm_name)
super().__init__(alarm_name, info, controller)
Expand All @@ -141,13 +142,6 @@ def async_update_callback(self, partition):
if partition is None or int(partition) == self._partition_number:
self.async_write_ha_state()

@property
def code_format(self) -> CodeFormat | None:
"""Regex for code format or None if no code is required."""
if self._code:
return None
return CodeFormat.NUMBER

@property
def state(self) -> str:
"""Return the state of the device."""
Expand All @@ -169,44 +163,23 @@ def state(self) -> str:

async def async_alarm_disarm(self, code: str | None = None) -> None:
"""Send disarm command."""
if code:
self.hass.data[DATA_EVL].disarm_partition(str(code), self._partition_number)
else:
self.hass.data[DATA_EVL].disarm_partition(
str(self._code), self._partition_number
)
self.hass.data[DATA_EVL].disarm_partition(code, self._partition_number)

async def async_alarm_arm_home(self, code: str | None = None) -> None:
"""Send arm home command."""
if code:
self.hass.data[DATA_EVL].arm_stay_partition(
str(code), self._partition_number
)
else:
self.hass.data[DATA_EVL].arm_stay_partition(
str(self._code), self._partition_number
)
self.hass.data[DATA_EVL].arm_stay_partition(code, self._partition_number)

async def async_alarm_arm_away(self, code: str | None = None) -> None:
"""Send arm away command."""
if code:
self.hass.data[DATA_EVL].arm_away_partition(
str(code), self._partition_number
)
else:
self.hass.data[DATA_EVL].arm_away_partition(
str(self._code), self._partition_number
)
self.hass.data[DATA_EVL].arm_away_partition(code, self._partition_number)

async def async_alarm_trigger(self, code: str | None = None) -> None:
"""Alarm trigger command. Will be used to trigger a panic alarm."""
self.hass.data[DATA_EVL].panic_alarm(self._panic_type)

async def async_alarm_arm_night(self, code: str | None = None) -> None:
"""Send arm night command."""
self.hass.data[DATA_EVL].arm_night_partition(
str(code) if code else str(self._code), self._partition_number
)
self.hass.data[DATA_EVL].arm_night_partition(code, self._partition_number)

@callback
def async_alarm_keypress(self, keypress=None):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/frontend/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"documentation": "https://www.home-assistant.io/integrations/frontend",
"integration_type": "system",
"quality_scale": "internal",
"requirements": ["home-assistant-frontend==20240605.0"]
"requirements": ["home-assistant-frontend==20240610.0"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/gardena_bluetooth/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"dependencies": ["bluetooth_adapters"],
"documentation": "https://www.home-assistant.io/integrations/gardena_bluetooth",
"iot_class": "local_polling",
"requirements": ["gardena-bluetooth==1.4.1"]
"requirements": ["gardena-bluetooth==1.4.2"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/glances/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/glances",
"iot_class": "local_polling",
"loggers": ["glances_api"],
"requirements": ["glances-api==0.7.0"]
"requirements": ["glances-api==0.8.0"]
}
Loading

0 comments on commit 090d296

Please sign in to comment.