Replace MyChevy persistant_notification with error log entry (#19804)

The mychevy service is notoriously unreliable, often only having 50% uptime. 
Previously a persistent notification was emitted when the platform errored out. 
Users have found that is happening too often, so instead log an error when
this happens instead.
This commit is contained in:
Rene Nulsch 2019-01-08 14:06:08 +01:00 committed by Sean Dague
parent 4bbfc04f5e
commit 410f19c777

View File

@ -8,7 +8,7 @@ import logging
from homeassistant.components.mychevy import (
EVSensorConfig, DOMAIN as MYCHEVY_DOMAIN, MYCHEVY_ERROR, MYCHEVY_SUCCESS,
NOTIFICATION_ID, NOTIFICATION_TITLE, UPDATE_TOPIC, ERROR_TOPIC
UPDATE_TOPIC, ERROR_TOPIC
)
from homeassistant.components.sensor import ENTITY_ID_FORMAT
from homeassistant.core import callback
@ -74,13 +74,10 @@ class MyChevyStatus(Entity):
@callback
def error(self):
"""Update state, trigger updates."""
if self._state != MYCHEVY_ERROR:
self.hass.components.persistent_notification.create(
"Error:<br/>Connection to mychevy website failed. "
"This probably means the mychevy to OnStar link is down.",
title=NOTIFICATION_TITLE,
notification_id=NOTIFICATION_ID)
self._state = MYCHEVY_ERROR
_LOGGER.error(
"Connection to mychevy website failed. "
"This probably means the mychevy to OnStar link is down")
self._state = MYCHEVY_ERROR
self.async_schedule_update_ha_state()
@property