From 26b097b86056785c47e81acea5aa58cd57eb85ab Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 1 Nov 2017 01:10:36 -0700 Subject: [PATCH] Change introduction card to use persistent notification (#10265) * Change introduction card to use persistent notification * Lint --- homeassistant/components/introduction.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/introduction.py b/homeassistant/components/introduction.py index 367eeb1a6c3..cc3e00c4475 100644 --- a/homeassistant/components/introduction.py +++ b/homeassistant/components/introduction.py @@ -4,6 +4,7 @@ Component that will help guide the user taking its first steps. For more details about this component, please refer to the documentation at https://home-assistant.io/components/introduction/ """ +import asyncio import logging import voluptuous as vol @@ -15,7 +16,8 @@ CONFIG_SCHEMA = vol.Schema({ }, extra=vol.ALLOW_EXTRA) -def setup(hass, config=None): +@asyncio.coroutine +def async_setup(hass, config=None): """Set up the introduction component.""" log = logging.getLogger(__name__) log.info(""" @@ -46,4 +48,16 @@ def setup(hass, config=None): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """) + hass.components.persistent_notification.async_create(""" +Here are some resources to get started: + + - [Configuring Home Assistant](https://home-assistant.io/getting-started/configuration/) + - [Available components](https://home-assistant.io/components/) + - [Troubleshooting your configuration](https://home-assistant.io/docs/configuration/troubleshooting/) + - [Getting help](https://home-assistant.io/help/) + +To not see this card popup in the future, edit your config in +`configuration.yaml` and disable the `introduction` component. +""", 'Welcome Home!') # noqa + return True