"""

For more details about HAChina,
https://www.hachina.io/
"""
import asyncio
import logging

import voluptuous as vol

DOMAIN = 'introduction'

CONFIG_SCHEMA = vol.Schema({
    DOMAIN: vol.Schema({}),
}, extra=vol.ALLOW_EXTRA)


@asyncio.coroutine
def async_setup(hass, config=None):
    """Set up the introduction component."""
    log = logging.getLogger(__name__)
    log.info("""

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        欢迎使用HACHINA.IO创建的镜像文件！

        我们的网站https://www.hachina.io


        This message is generated by the introduction_hachina component. You can
        disable it in configuration.yaml.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    """)

    hass.components.persistent_notification.async_create("""
[![HACHINA](https://www.hachina.io/wp-content/themes/haChina/images/logo@2x.png)](https://www.hachina.io)

在此镜像文件中，我们安装与开放了以下服务:

 - [HomeAssistant](https://home-assistant.io/)
 - [HomeBridge](https://github.com/nfarina/homebridge)
 - [Jupyter Notebook](http://jupyter.org/)
 - [Mosquitto](http://www.mosquitto.org/)
 - [Samba](https://www.samba.org/)
 - [SshD](https://www.openssh.com/)
 
密码与修改:

 - 操作系统的`pi`账号，初始密码为`hachina`。以`pi`账号登录后，使用`passwd`命令修改
 - HomeAssistant的访问密码空。在其配置文件`configuration.yaml`中修改
 - HomeBridge的初始PIN码`123-66-789`。在`/home/pi/.homebridge/config.json`文件中修改
 - Jupyter Notebook的初始访问密码为`hachina`。以`pi`账号登录后，使用`jupyter notebook password`命令修改
 - Mosquitto的用户名为`pi`，初始密码为`hachina`。以`pi`账号登录后，使用`sudo mosquitto_passwd /etc/mosquitto/passwd homeassistant`命令修改

 
我们的网站：[https://www.hachina.io](https://www.hachina.io)

欲去除本卡信息，请编辑`configuration.yaml`文件，删除或注释调`introduction_hachina`组件
""", '欢迎使用HACHINA.IO创建的镜像文件！')  # noqa

    return True

Create introduction_hachina.py