mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
discover binary sensor
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user