Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
83fb5e5
Apply recommendations from IPP review (#33477)
ctalkington Mar 31, 2020
2cfa0af
[ci skip] Translation update
homeassistant Apr 1, 2020
cc443ff
Add config flow for nut (#33457)
bdraco Apr 1, 2020
0e6aacb
Bump up zha dependencies. (#33488)
Adminiuga Apr 1, 2020
3d73f16
Correct issue on new device joins in ZHA (#33470)
dmulcahey Apr 1, 2020
4dbbf93
Replace asyncio.wait with asyncio.gather since wait ignores exception…
ziv1234 Apr 1, 2020
eff9b2a
Clean up ZHA channel reporting configuration (#33497)
Adminiuga Apr 1, 2020
fb93b79
Add MQTT debug info (#33461)
emontnemery Apr 1, 2020
0cf9268
Fix invalid directory for dnsmasq files in asuswrt (#33503)
springstan Apr 1, 2020
4a32a0f
Expand network util to check for link local addresses (#33499)
bdraco Apr 1, 2020
400602a
Updated frontend to 20200401.0 (#33505)
bramkragten Apr 1, 2020
71aaf2d
Add device triggers for Hue remotes (#33476)
azogue Apr 1, 2020
c63ec69
Update translations
balloob Apr 1, 2020
fbd1971
Add MQTT debug info for remaining MQTT integrations (#33506)
emontnemery Apr 1, 2020
775010f
Add Rachio Schedules (#33421)
brg468 Apr 1, 2020
4e043b3
Update azure-pipelines-wheels.yml for Azure Pipelines
pvizeli Apr 1, 2020
aaa1d06
Directly call async_write_ha_state (#33508)
balloob Apr 1, 2020
7ae802b
Cloud do checks during setup (#33507)
balloob Apr 1, 2020
4a4496b
[ci skip] Translation update
homeassistant Apr 2, 2020
e28bcb5
Update azure-pipelines-wheels.yml for Azure Pipelines
pvizeli Apr 2, 2020
be3cf52
Update to roku==4.1.0 (#33520)
ctalkington Apr 2, 2020
58ae117
Add availability to opentherm_gw entities (#32408)
mvn23 Apr 2, 2020
5a55d50
Bump brother to 0.1.11 (#33526)
bieniu Apr 2, 2020
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
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ homeassistant/components/nsw_fuel_station/* @nickw444
homeassistant/components/nsw_rural_fire_service_feed/* @exxamalte
homeassistant/components/nuheat/* @bdraco
homeassistant/components/nuki/* @pvizeli
homeassistant/components/nut/* @bdraco
homeassistant/components/nws/* @MatthewFlamm
homeassistant/components/nzbget/* @chriscla
homeassistant/components/obihai/* @dshokouhi
Expand Down
4 changes: 1 addition & 3 deletions azure-pipelines-wheels.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# https://dev.azure.com/home-assistant

trigger:
batch: true
branches:
include:
- dev
Expand All @@ -16,7 +15,6 @@ schedules:
branches:
include:
- dev
always: true
variables:
- name: versionWheels
value: '1.10.1-3.7-alpine3.11'
Expand Down Expand Up @@ -73,4 +71,4 @@ jobs:
sed -i "s|# bme680|bme680|g" ${requirement_file}
sed -i "s|# python-gammu|python-gammu|g" ${requirement_file}
done
displayName: 'Prepare requirements files for Hass.io'
displayName: 'Prepare requirements files for Home Assistant wheels'
37 changes: 22 additions & 15 deletions homeassistant/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,30 @@ async def _async_set_up_integrations(
hass: core.HomeAssistant, config: Dict[str, Any]
) -> None:
"""Set up all the integrations."""

async def async_setup_multi_components(domains: Set[str]) -> None:
"""Set up multiple domains. Log on failure."""
futures = {
domain: hass.async_create_task(async_setup_component(hass, domain, config))
for domain in domains
}
await asyncio.wait(futures.values())
errors = [domain for domain in domains if futures[domain].exception()]
for domain in errors:
exception = futures[domain].exception()
_LOGGER.error(
"Error setting up integration %s - received exception",
domain,
exc_info=(type(exception), exception, exception.__traceback__),
)

domains = _get_domains(hass, config)

# Start up debuggers. Start these first in case they want to wait.
debuggers = domains & DEBUGGER_INTEGRATIONS
if debuggers:
_LOGGER.debug("Starting up debuggers %s", debuggers)
await asyncio.gather(
*(async_setup_component(hass, domain, config) for domain in debuggers)
)
await async_setup_multi_components(debuggers)
domains -= DEBUGGER_INTEGRATIONS

# Resolve all dependencies of all components so we can find the logging
Expand All @@ -358,9 +373,7 @@ async def _async_set_up_integrations(
if logging_domains:
_LOGGER.info("Setting up %s", logging_domains)

await asyncio.gather(
*(async_setup_component(hass, domain, config) for domain in logging_domains)
)
await async_setup_multi_components(logging_domains)

# Kick off loading the registries. They don't need to be awaited.
asyncio.gather(
Expand All @@ -370,9 +383,7 @@ async def _async_set_up_integrations(
)

if stage_1_domains:
await asyncio.gather(
*(async_setup_component(hass, domain, config) for domain in stage_1_domains)
)
await async_setup_multi_components(stage_1_domains)

# Load all integrations
after_dependencies: Dict[str, Set[str]] = {}
Expand Down Expand Up @@ -401,9 +412,7 @@ async def _async_set_up_integrations(

_LOGGER.debug("Setting up %s", domains_to_load)

await asyncio.gather(
*(async_setup_component(hass, domain, config) for domain in domains_to_load)
)
await async_setup_multi_components(domains_to_load)

last_load = domains_to_load
stage_2_domains -= domains_to_load
Expand All @@ -413,9 +422,7 @@ async def _async_set_up_integrations(
if stage_2_domains:
_LOGGER.debug("Final set up: %s", stage_2_domains)

await asyncio.gather(
*(async_setup_component(hass, domain, config) for domain in stage_2_domains)
)
await async_setup_multi_components(stage_2_domains)

# Wrap up startup
await hass.async_block_till_done()
8 changes: 8 additions & 0 deletions homeassistant/components/airvisual/.translations/lb.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,13 @@
}
},
"title": "AirVisual"
},
"options": {
"step": {
"init": {
"description": "Verschidden Optioune fir d'AirVisual Integratioun d\u00e9fin\u00e9ieren.",
"title": "Airvisual ariichten"
}
}
}
}
4 changes: 2 additions & 2 deletions homeassistant/components/alert/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ async def begin_alerting(self):
else:
await self._schedule_notify()

self.async_schedule_update_ha_state()
self.async_write_ha_state()

async def end_alerting(self):
"""End the alert procedures."""
Expand All @@ -259,7 +259,7 @@ async def end_alerting(self):
self._firing = False
if self._send_done_message:
await self._notify_done_message()
self.async_schedule_update_ha_state()
self.async_write_ha_state()

async def _schedule_notify(self):
"""Schedule a notification."""
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/android_ip_webcam/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async def async_turn_on(self, **kwargs):
else:
await self._ipcam.change_setting(self._setting, True)
self._state = True
self.async_schedule_update_ha_state()
self.async_write_ha_state()

async def async_turn_off(self, **kwargs):
"""Turn device off."""
Expand All @@ -80,7 +80,7 @@ async def async_turn_off(self, **kwargs):
else:
await self._ipcam.change_setting(self._setting, False)
self._state = False
self.async_schedule_update_ha_state()
self.async_write_ha_state()

@property
def icon(self):
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/apple_tv/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def state(self):
def playstatus_update(self, updater, playing):
"""Print what is currently playing when it changes."""
self._playing = playing
self.async_schedule_update_ha_state()
self.async_write_ha_state()

@callback
def playstatus_error(self, updater, exception):
Expand All @@ -151,7 +151,7 @@ def playstatus_error(self, updater, exception):
# implemented here later.
updater.start(initial_delay=10)
self._playing = None
self.async_schedule_update_ha_state()
self.async_write_ha_state()

@property
def media_content_type(self):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/aqualogic/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ def async_update_callback(self):
panel = self._processor.panel
if panel is not None:
self._state = getattr(panel, self._type)
self.async_schedule_update_ha_state()
self.async_write_ha_state()
15 changes: 7 additions & 8 deletions homeassistant/components/aqualogic/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
from homeassistant.const import CONF_MONITORED_CONDITIONS
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv

from . import DOMAIN, UPDATE_TOPIC
Expand Down Expand Up @@ -51,7 +50,6 @@ class AquaLogicSwitch(SwitchDevice):

def __init__(self, processor, switch_type):
"""Initialize switch."""

self._processor = processor
self._type = switch_type
self._state_name = {
Expand All @@ -66,6 +64,7 @@ def __init__(self, processor, switch_type):
"aux_6": States.AUX_6,
"aux_7": States.AUX_7,
}[switch_type]
self._unsub_disp = None

@property
def name(self):
Expand Down Expand Up @@ -102,11 +101,11 @@ def turn_off(self, **kwargs):

async def async_added_to_hass(self):
"""Register callbacks."""
self.hass.helpers.dispatcher.async_dispatcher_connect(
UPDATE_TOPIC, self.async_update_callback
self._unsub_disp = self.hass.helpers.dispatcher.async_dispatcher_connect(
UPDATE_TOPIC, self.async_write_ha_state
)

@callback
def async_update_callback(self):
"""Update callback."""
self.async_schedule_update_ha_state()
async def async_will_remove_from_hass(self):
"""When entity will be removed from hass."""
self._unsub_disp()
self._unsub_disp = None
14 changes: 7 additions & 7 deletions homeassistant/components/arcam_fmj/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ async def async_added_to_hass(self):
@callback
def _data(host):
if host == self._state.client.host:
self.async_schedule_update_ha_state()
self.async_write_ha_state()

@callback
def _started(host):
Expand Down Expand Up @@ -160,7 +160,7 @@ async def async_update(self):
async def async_mute_volume(self, mute):
"""Send mute command."""
await self._state.set_mute(mute)
self.async_schedule_update_ha_state()
self.async_write_ha_state()

async def async_select_source(self, source):
"""Select a specific source."""
Expand All @@ -171,7 +171,7 @@ async def async_select_source(self, source):
return

await self._state.set_source(value)
self.async_schedule_update_ha_state()
self.async_write_ha_state()

async def async_select_sound_mode(self, sound_mode):
"""Select a specific source."""
Expand All @@ -184,22 +184,22 @@ async def async_select_sound_mode(self, sound_mode):
_LOGGER.error("Unsupported sound_mode %s", sound_mode)
return

self.async_schedule_update_ha_state()
self.async_write_ha_state()

async def async_set_volume_level(self, volume):
"""Set volume level, range 0..1."""
await self._state.set_volume(round(volume * 99.0))
self.async_schedule_update_ha_state()
self.async_write_ha_state()

async def async_volume_up(self):
"""Turn volume up for media player."""
await self._state.inc_volume()
self.async_schedule_update_ha_state()
self.async_write_ha_state()

async def async_volume_down(self):
"""Turn volume up for media player."""
await self._state.dec_volume()
self.async_schedule_update_ha_state()
self.async_write_ha_state()

async def async_turn_on(self):
"""Turn the media player on."""
Expand Down
14 changes: 8 additions & 6 deletions homeassistant/components/arlo/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
from homeassistant.components.ffmpeg import DATA_FFMPEG
from homeassistant.const import ATTR_BATTERY_LEVEL
from homeassistant.core import callback
from homeassistant.helpers.aiohttp_client import async_aiohttp_proxy_stream
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import async_dispatcher_connect
Expand Down Expand Up @@ -62,19 +61,22 @@ def __init__(self, hass, camera, device_info):
self._ffmpeg_arguments = device_info.get(CONF_FFMPEG_ARGUMENTS)
self._last_refresh = None
self.attrs = {}
self._unsub_disp = None

def camera_image(self):
"""Return a still image response from the camera."""
return self._camera.last_image_from_cache

async def async_added_to_hass(self):
"""Register callbacks."""
async_dispatcher_connect(self.hass, SIGNAL_UPDATE_ARLO, self._update_callback)
self._unsub_disp = async_dispatcher_connect(
self.hass, SIGNAL_UPDATE_ARLO, self.async_write_ha_state
)

@callback
def _update_callback(self):
"""Call update method."""
self.async_schedule_update_ha_state()
async def async_will_remove_from_hass(self):
"""When entity will be removed from hass."""
self._unsub_disp()
self._unsub_disp = None

async def handle_async_mjpeg_stream(self, request):
"""Generate an HTTP MJPEG stream from the camera."""
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/arwn/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def set_event(self, event):
"""Update the sensor with the most recent event."""
self.event = {}
self.event.update(event)
self.async_schedule_update_ha_state()
self.async_write_ha_state()

@property
def state(self):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/asuswrt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
cv.ensure_list, [vol.In(SENSOR_TYPES)]
),
vol.Optional(CONF_INTERFACE, default=DEFAULT_INTERFACE): cv.string,
vol.Optional(CONF_DNSMASQ, default=DEFAULT_DNSMASQ): cv.isdir,
vol.Optional(CONF_DNSMASQ, default=DEFAULT_DNSMASQ): cv.string,
}
)
},
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/axis/axis_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def device_info(self):
@callback
def update_callback(self, no_delay=None):
"""Update the entities state."""
self.async_schedule_update_ha_state()
self.async_write_ha_state()


class AxisEventBase(AxisEntityBase):
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/axis/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ def update_callback(self, no_delay=False):
self.remove_timer = None

if self.is_on or delay == 0 or no_delay:
self.async_schedule_update_ha_state()
self.async_write_ha_state()
return

@callback
def _delay_update(now):
"""Timer callback for sensor update."""
self.async_schedule_update_ha_state()
self.async_write_ha_state()
self.remove_timer = None

self.remove_timer = async_track_point_in_utc_time(
Expand Down
5 changes: 4 additions & 1 deletion homeassistant/components/axis/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Config flow to configure Axis devices."""

from ipaddress import ip_address

import voluptuous as vol

from homeassistant import config_entries
Expand All @@ -11,6 +13,7 @@
CONF_PORT,
CONF_USERNAME,
)
from homeassistant.util.network import is_link_local

from .const import CONF_MODEL, DOMAIN
from .device import get_device
Expand Down Expand Up @@ -129,7 +132,7 @@ async def async_step_zeroconf(self, discovery_info):
if serial_number[:6] not in AXIS_OUI:
return self.async_abort(reason="not_axis_device")

if discovery_info[CONF_HOST].startswith("169.254"):
if is_link_local(ip_address(discovery_info[CONF_HOST])):
return self.async_abort(reason="link_local_address")

await self.async_set_unique_id(serial_number)
Expand Down
Loading