Change persistent notification to avoid long text in entity state (#9967)

* Change persistent notification to avoid long text in entity state

* Tests for changed persistent notification

* Persistent notification state

* Test for component state
This commit is contained in:
milanvo authored and Pascal Vizeli committed 2017-10-21 21:59:05 +02:00
1 parent 3ea4691fce
commit bf26b75d27
2 files changed
+10 -5

No files matched your search

@@ -43,6 +43,8 @@ SCHEMA_SERVICE_DISMISS = vol.Schema({
DEFAULT_OBJECT_ID = 'notification'
_LOGGER = logging.getLogger(__name__)
STATE = 'notifying'
@bind_hass
def create(hass, message, title=None, notification_id=None):
@@ -113,7 +115,9 @@ def async_setup(hass, config):
_LOGGER.error('Error rendering message %s: %s', message, ex)
message = message.template
hass.states.async_set(entity_id, message, attr)
attr[ATTR_MESSAGE] = message
hass.states.async_set(entity_id, STATE, attr)
@callback
def dismiss_service(call):