Change introduction card to use persistent notification (#10265)

* Change introduction card to use persistent notification

* Lint
This commit is contained in:
Paulus Schoutsen 2017-11-01 01:10:36 -07:00 committed by Fabian Affolter
parent 4e8723f345
commit 26b097b860

View file

@ -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 For more details about this component, please refer to the documentation at
https://home-assistant.io/components/introduction/ https://home-assistant.io/components/introduction/
""" """
import asyncio
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -15,7 +16,8 @@ CONFIG_SCHEMA = vol.Schema({
}, extra=vol.ALLOW_EXTRA) }, extra=vol.ALLOW_EXTRA)
def setup(hass, config=None): @asyncio.coroutine
def async_setup(hass, config=None):
"""Set up the introduction component.""" """Set up the introduction component."""
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
log.info(""" 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 return True