1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Fix cert expiry config flow check and update (#26638)

* Fix typo in translations

* Work on bug #26619

* readd the homeassistant.start event

* Remove the callback

* Added the executor_job for _test_connection

* Update test_config_flow.py
This commit is contained in:
Maikel Punie
2019-09-17 22:39:46 +02:00
committed by Paulus Schoutsen
parent 504b8c7685
commit 9114ed36cd
5 changed files with 26 additions and 18 deletions

View File

@@ -9,7 +9,12 @@ import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_HOST, CONF_PORT
from homeassistant.const import (
CONF_NAME,
CONF_HOST,
CONF_PORT,
EVENT_HOMEASSISTANT_START,
)
from homeassistant.helpers.entity import Entity
from .const import DOMAIN, DEFAULT_NAME, DEFAULT_PORT
@@ -82,6 +87,15 @@ class SSLCertificate(Entity):
"""Icon to use in the frontend, if any."""
return self._available
async def async_added_to_hass(self):
"""Once the entity is added we should update to get the initial data loaded."""
def do_update(_):
"""Run the update method when the start event was fired."""
self.update()
self.hass.bus.async_listen_once(EVENT_HOMEASSISTANT_START, do_update)
def update(self):
"""Fetch the certificate information."""
try: