-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
31 lines (21 loc) · 852 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
The "hello world" custom component.
This component implements the bare minimum that a component should implement.
Configuration:
To use the hello_world component you will need to add the following to your
configuration.yaml file.
hello_world_async:
"""
from __future__ import annotations
import asyncio
from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import ConfigType
# The domain of your component. Should be equal to the name of your component.
DOMAIN = "hello_world_async"
@asyncio.coroutine
def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Setup our skeleton component."""
# States are in the format DOMAIN.OBJECT_ID.
hass.states.async_set('hello_world_async.Hello_World', 'Works!')
# Return boolean to indicate that initialization was successfully.
return True