Skip to content

Commit

Permalink
Merge branch 'home-assistant:dev' into voice-assist-port
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatguy85 committed Jan 12, 2024
2 parents cb4909b + dc10f3c commit c569fe7
Show file tree
Hide file tree
Showing 423 changed files with 7,491 additions and 7,642 deletions.
8 changes: 3 additions & 5 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ omit =
homeassistant/components/adguard/sensor.py
homeassistant/components/adguard/switch.py
homeassistant/components/ads/*
homeassistant/components/aemet/weather_update_coordinator.py
homeassistant/components/aftership/__init__.py
homeassistant/components/aftership/sensor.py
homeassistant/components/agent_dvr/alarm_control_panel.py
Expand Down Expand Up @@ -474,6 +473,7 @@ omit =
homeassistant/components/guardian/sensor.py
homeassistant/components/guardian/switch.py
homeassistant/components/guardian/util.py
homeassistant/components/guardian/valve.py
homeassistant/components/habitica/__init__.py
homeassistant/components/habitica/sensor.py
homeassistant/components/harman_kardon_avr/media_player.py
Expand Down Expand Up @@ -664,10 +664,6 @@ omit =
homeassistant/components/lg_netcast/media_player.py
homeassistant/components/lg_soundbar/__init__.py
homeassistant/components/lg_soundbar/media_player.py
homeassistant/components/life360/__init__.py
homeassistant/components/life360/button.py
homeassistant/components/life360/coordinator.py
homeassistant/components/life360/device_tracker.py
homeassistant/components/lightwave/*
homeassistant/components/limitlessled/light.py
homeassistant/components/linksys_smart/device_tracker.py
Expand Down Expand Up @@ -764,6 +760,7 @@ omit =
homeassistant/components/motionmount/__init__.py
homeassistant/components/motionmount/entity.py
homeassistant/components/motionmount/number.py
homeassistant/components/motionmount/select.py
homeassistant/components/mpd/media_player.py
homeassistant/components/mqtt_room/sensor.py
homeassistant/components/msteams/notify.py
Expand Down Expand Up @@ -1616,6 +1613,7 @@ omit =
homeassistant/components/yolink/entity.py
homeassistant/components/yolink/light.py
homeassistant/components/yolink/lock.py
homeassistant/components/yolink/number.py
homeassistant/components/yolink/sensor.py
homeassistant/components/yolink/siren.py
homeassistant/components/yolink/switch.py
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
env:
BUILD_TYPE: core
DEFAULT_PYTHON: "3.12"
PIP_TIMEOUT: 60

jobs:
init:
Expand Down
17 changes: 15 additions & 2 deletions .strict-typing
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ homeassistant.components.dhcp.*
homeassistant.components.diagnostics.*
homeassistant.components.discovergy.*
homeassistant.components.dlna_dmr.*
homeassistant.components.dlna_dms.*
homeassistant.components.dnsip.*
homeassistant.components.doorbird.*
homeassistant.components.dormakaba_dkey.*
Expand All @@ -155,6 +156,7 @@ homeassistant.components.emulated_hue.*
homeassistant.components.energy.*
homeassistant.components.energyzero.*
homeassistant.components.enigma2.*
homeassistant.components.enphase_envoy.*
homeassistant.components.esphome.*
homeassistant.components.event.*
homeassistant.components.evil_genius_labs.*
Expand All @@ -176,12 +178,14 @@ homeassistant.components.fritzbox_callmonitor.*
homeassistant.components.fronius.*
homeassistant.components.frontend.*
homeassistant.components.fully_kiosk.*
homeassistant.components.generic_hygrostat.*
homeassistant.components.geo_location.*
homeassistant.components.geocaching.*
homeassistant.components.gios.*
homeassistant.components.glances.*
homeassistant.components.goalzero.*
homeassistant.components.google.*
homeassistant.components.google_assistant_sdk.*
homeassistant.components.google_sheets.*
homeassistant.components.gpsd.*
homeassistant.components.greeneye_monitor.*
Expand All @@ -191,9 +195,9 @@ homeassistant.components.hardkernel.*
homeassistant.components.hardware.*
homeassistant.components.here_travel_time.*
homeassistant.components.history.*
homeassistant.components.history_stats.*
homeassistant.components.holiday.*
homeassistant.components.homeassistant.exposed_entities
homeassistant.components.homeassistant.triggers.event
homeassistant.components.homeassistant.*
homeassistant.components.homeassistant_alerts.*
homeassistant.components.homeassistant_green.*
homeassistant.components.homeassistant_hardware.*
Expand Down Expand Up @@ -225,6 +229,7 @@ homeassistant.components.input_button.*
homeassistant.components.input_select.*
homeassistant.components.input_text.*
homeassistant.components.integration.*
homeassistant.components.intent.*
homeassistant.components.ipp.*
homeassistant.components.iqvia.*
homeassistant.components.islamic_prayer_times.*
Expand All @@ -242,6 +247,7 @@ homeassistant.components.laundrify.*
homeassistant.components.lawn_mower.*
homeassistant.components.lcn.*
homeassistant.components.ld2410_ble.*
homeassistant.components.led_ble.*
homeassistant.components.lidarr.*
homeassistant.components.lifx.*
homeassistant.components.light.*
Expand All @@ -263,6 +269,7 @@ homeassistant.components.matter.*
homeassistant.components.media_extractor.*
homeassistant.components.media_player.*
homeassistant.components.media_source.*
homeassistant.components.met_eireann.*
homeassistant.components.metoffice.*
homeassistant.components.mikrotik.*
homeassistant.components.min_max.*
Expand All @@ -283,6 +290,7 @@ homeassistant.components.netatmo.*
homeassistant.components.network.*
homeassistant.components.nextdns.*
homeassistant.components.nfandroidtv.*
homeassistant.components.nightscout.*
homeassistant.components.nissan_leaf.*
homeassistant.components.no_ip.*
homeassistant.components.notify.*
Expand All @@ -295,6 +303,7 @@ homeassistant.components.open_meteo.*
homeassistant.components.openexchangerates.*
homeassistant.components.opensky.*
homeassistant.components.openuv.*
homeassistant.components.oralb.*
homeassistant.components.otbr.*
homeassistant.components.overkiz.*
homeassistant.components.p1_monitor.*
Expand Down Expand Up @@ -373,6 +382,7 @@ homeassistant.components.switchbee.*
homeassistant.components.switchbot_cloud.*
homeassistant.components.switcher_kis.*
homeassistant.components.synology_dsm.*
homeassistant.components.system_health.*
homeassistant.components.systemmonitor.*
homeassistant.components.tag.*
homeassistant.components.tailscale.*
Expand All @@ -388,6 +398,7 @@ homeassistant.components.tile.*
homeassistant.components.tilt_ble.*
homeassistant.components.time.*
homeassistant.components.time_date.*
homeassistant.components.tod.*
homeassistant.components.todo.*
homeassistant.components.tolo.*
homeassistant.components.tplink.*
Expand Down Expand Up @@ -417,6 +428,7 @@ homeassistant.components.vlc_telnet.*
homeassistant.components.wake_on_lan.*
homeassistant.components.wake_word.*
homeassistant.components.wallbox.*
homeassistant.components.waqi.*
homeassistant.components.water_heater.*
homeassistant.components.watttime.*
homeassistant.components.weather.*
Expand All @@ -430,6 +442,7 @@ homeassistant.components.wled.*
homeassistant.components.worldclock.*
homeassistant.components.yale_smart_alarm.*
homeassistant.components.yalexs_ble.*
homeassistant.components.youtube.*
homeassistant.components.zeroconf.*
homeassistant.components.zodiac.*
homeassistant.components.zone.*
Expand Down
10 changes: 4 additions & 6 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ build.json @home-assistant/supervisor
/tests/components/airnow/ @asymworks
/homeassistant/components/airq/ @Sibgatulin @dl2080
/tests/components/airq/ @Sibgatulin @dl2080
/homeassistant/components/airthings/ @danielhiversen
/tests/components/airthings/ @danielhiversen
/homeassistant/components/airthings/ @danielhiversen @LaStrada
/tests/components/airthings/ @danielhiversen @LaStrada
/homeassistant/components/airthings_ble/ @vincegio @LaStrada
/tests/components/airthings_ble/ @vincegio @LaStrada
/homeassistant/components/airtouch4/ @samsinnamon
Expand Down Expand Up @@ -706,8 +706,6 @@ build.json @home-assistant/supervisor
/homeassistant/components/lg_netcast/ @Drafteed
/homeassistant/components/lidarr/ @tkdrob
/tests/components/lidarr/ @tkdrob
/homeassistant/components/life360/ @pnbruckner
/tests/components/life360/ @pnbruckner
/homeassistant/components/light/ @home-assistant/core
/tests/components/light/ @home-assistant/core
/homeassistant/components/linear_garage_door/ @IceBotYT
Expand Down Expand Up @@ -1304,8 +1302,8 @@ build.json @home-assistant/supervisor
/tests/components/system_bridge/ @timmo001
/homeassistant/components/systemmonitor/ @gjohansson-ST
/tests/components/systemmonitor/ @gjohansson-ST
/homeassistant/components/tado/ @michaelarnauts @chiefdragon @erwindouna
/tests/components/tado/ @michaelarnauts @chiefdragon @erwindouna
/homeassistant/components/tado/ @chiefdragon @erwindouna
/tests/components/tado/ @chiefdragon @erwindouna
/homeassistant/components/tag/ @balloob @dmulcahey
/tests/components/tag/ @balloob @dmulcahey
/homeassistant/components/tailscale/ @frenck
Expand Down
41 changes: 36 additions & 5 deletions homeassistant/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import voluptuous as vol
import yarl

from . import config as conf_util, config_entries, core, loader
from . import config as conf_util, config_entries, core, loader, requirements
from .components import http
from .const import (
FORMAT_DATETIME,
Expand Down Expand Up @@ -229,7 +229,7 @@ def open_hass_ui(hass: core.HomeAssistant) -> None:
)


async def load_registries(hass: core.HomeAssistant) -> None:
async def async_load_base_functionality(hass: core.HomeAssistant) -> None:
"""Load the registries and cache the result of platform.uname().processor."""
if DATA_REGISTRIES_LOADED in hass.data:
return
Expand All @@ -256,6 +256,7 @@ def _cache_uname_processor() -> None:
hass.async_add_executor_job(_cache_uname_processor),
template.async_load_custom_templates(hass),
restore_state.async_load(hass),
hass.config_entries.async_initialize(),
)


Expand All @@ -270,8 +271,7 @@ async def async_from_config_dict(
start = monotonic()

hass.config_entries = config_entries.ConfigEntries(hass, config)
await hass.config_entries.async_initialize()
await load_registries(hass)
await async_load_base_functionality(hass)

# Set up core.
_LOGGER.debug("Setting up %s", CORE_INTEGRATIONS)
Expand Down Expand Up @@ -527,11 +527,13 @@ async def async_setup_multi_components(
config: dict[str, Any],
) -> None:
"""Set up multiple domains. Log on failure."""
# Avoid creating tasks for domains that were setup in a previous stage
domains_not_yet_setup = domains - hass.config.components
futures = {
domain: hass.async_create_task(
async_setup_component(hass, domain, config), f"setup component {domain}"
)
for domain in domains
for domain in domains_not_yet_setup
}
results = await asyncio.gather(*futures.values(), return_exceptions=True)
for idx, domain in enumerate(futures):
Expand All @@ -555,6 +557,8 @@ async def _async_set_up_integrations(

domains_to_setup = _get_domains(hass, config)

needed_requirements: set[str] = set()

# Resolve all dependencies so we know all integrations
# that will have to be loaded and start rightaway
integration_cache: dict[str, loader.Integration] = {}
Expand All @@ -570,6 +574,25 @@ async def _async_set_up_integrations(
).values()
if isinstance(int_or_exc, loader.Integration)
]

manifest_deps: set[str] = set()
for itg in integrations_to_process:
manifest_deps.update(itg.dependencies)
manifest_deps.update(itg.after_dependencies)
needed_requirements.update(itg.requirements)

if manifest_deps:
# If there are dependencies, try to preload all
# the integrations manifest at once and add them
# to the list of requirements we need to install
# so we can try to check if they are already installed
# in a single call below which avoids each integration
# having to wait for the lock to do it individually
deps = await loader.async_get_integrations(hass, manifest_deps)
for dependant_itg in deps.values():
if isinstance(dependant_itg, loader.Integration):
needed_requirements.update(dependant_itg.requirements)

resolve_dependencies_tasks = [
itg.resolve_dependencies()
for itg in integrations_to_process
Expand All @@ -591,6 +614,14 @@ async def _async_set_up_integrations(

_LOGGER.info("Domains to be set up: %s", domains_to_setup)

# Optimistically check if requirements are already installed
# ahead of setting up the integrations so we can prime the cache
# We do not wait for this since its an optimization only
hass.async_create_background_task(
requirements.async_load_installed_versions(hass, needed_requirements),
"check installed requirements",
)

# Initialize recorder
if "recorder" in domains_to_setup:
recorder.async_initialize_recorder(hass)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/aemet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ENTRY_WEATHER_COORDINATOR,
PLATFORMS,
)
from .weather_update_coordinator import WeatherUpdateCoordinator
from .coordinator import WeatherUpdateCoordinator

_LOGGER = logging.getLogger(__name__)

Expand Down
45 changes: 0 additions & 45 deletions homeassistant/components/aemet/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@

ATTR_API_CONDITION = "condition"
ATTR_API_FORECAST_CONDITION = "condition"
ATTR_API_FORECAST_DAILY = "forecast-daily"
ATTR_API_FORECAST_HOURLY = "forecast-hourly"
ATTR_API_FORECAST_PRECIPITATION = "precipitation"
ATTR_API_FORECAST_PRECIPITATION_PROBABILITY = "precipitation_probability"
ATTR_API_FORECAST_TEMP = "temperature"
Expand Down Expand Up @@ -101,49 +99,6 @@
AOD_COND_SUNNY: ATTR_CONDITION_SUNNY,
}

FORECAST_MONITORED_CONDITIONS = [
ATTR_API_FORECAST_CONDITION,
ATTR_API_FORECAST_PRECIPITATION,
ATTR_API_FORECAST_PRECIPITATION_PROBABILITY,
ATTR_API_FORECAST_TEMP,
ATTR_API_FORECAST_TEMP_LOW,
ATTR_API_FORECAST_TIME,
ATTR_API_FORECAST_WIND_BEARING,
ATTR_API_FORECAST_WIND_SPEED,
]
MONITORED_CONDITIONS = [
ATTR_API_CONDITION,
ATTR_API_HUMIDITY,
ATTR_API_PRESSURE,
ATTR_API_RAIN,
ATTR_API_RAIN_PROB,
ATTR_API_SNOW,
ATTR_API_SNOW_PROB,
ATTR_API_STATION_ID,
ATTR_API_STATION_NAME,
ATTR_API_STATION_TIMESTAMP,
ATTR_API_STORM_PROB,
ATTR_API_TEMPERATURE,
ATTR_API_TEMPERATURE_FEELING,
ATTR_API_TOWN_ID,
ATTR_API_TOWN_NAME,
ATTR_API_TOWN_TIMESTAMP,
ATTR_API_WIND_BEARING,
ATTR_API_WIND_MAX_SPEED,
ATTR_API_WIND_SPEED,
]

FORECAST_MODE_DAILY = "daily"
FORECAST_MODE_HOURLY = "hourly"
FORECAST_MODES = [
FORECAST_MODE_DAILY,
FORECAST_MODE_HOURLY,
]
FORECAST_MODE_ATTR_API = {
FORECAST_MODE_DAILY: ATTR_API_FORECAST_DAILY,
FORECAST_MODE_HOURLY: ATTR_API_FORECAST_HOURLY,
}

FORECAST_MAP = {
AOD_FORECAST_DAILY: {
AOD_CONDITION: ATTR_FORECAST_CONDITION,
Expand Down

0 comments on commit c569fe7

Please sign in to comment.