From 1aff744e508eb8a684543a2249d209b58ef2d6c9 Mon Sep 17 00:00:00 2001 From: Tobias Haase Date: Thu, 1 Aug 2019 23:51:46 +0200 Subject: [PATCH] discover binary sensor --- homeassistant/components/updater/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/updater/__init__.py b/homeassistant/components/updater/__init__.py index aa4b9d22803..9b9d5e67e1a 100644 --- a/homeassistant/components/updater/__init__.py +++ b/homeassistant/components/updater/__init__.py @@ -15,6 +15,7 @@ import voluptuous as vol from homeassistant.const import __version__ as current_version from homeassistant.helpers import event from homeassistant.helpers.aiohttp_client import async_get_clientsession +from homeassistant.helpers import discovery from homeassistant.helpers.dispatcher import async_dispatcher_send import homeassistant.helpers.config_validation as cv import homeassistant.util.dt as dt_util @@ -53,7 +54,7 @@ class Updater: """Updater class for data exchange.""" def __init__(self, update_available: bool, newest_version: str, release_notes: str): - """Setup Updater.""" + """Setup Updater and initialise attributes.""" self.update_available = update_available self.release_notes = release_notes self.newest_version = newest_version @@ -93,6 +94,10 @@ async def async_setup(hass, config): include_components = config.get(CONF_COMPONENT_REPORTING) + hass.async_create_task( + discovery.async_load_platform(hass, "binary_sensor", DOMAIN, {}, config) + ) + async def check_new_version(now): """Check if a new version is available and report if one is.""" result = await get_newest_version(hass, huuid, include_components) @@ -156,7 +161,7 @@ async def get_newest_version(hass, huuid, include_components): req = await session.post(UPDATER_URL, json=info_object) _LOGGER.info( ( - "Submitted analytics to Home Assistant servers." + "Submitted analytics to Home Assistant servers. " "Information submitted includes %s" ), info_object,