mirror of
https://github.com/home-assistant/core.git
synced 2025-06-11 00:27:10 +00:00
Added an example component that does the bare minimum
This commit is contained in:
parent
029c38874b
commit
df3ddea23c
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,6 +6,7 @@ homeassistant/components/http/www_static/polymer/bower_components/*
|
||||
!config/custom_components
|
||||
config/custom_components/*
|
||||
!config/custom_components/example.py
|
||||
!config/custom_components/hello_world.py
|
||||
|
||||
# Hide sublime text stuff
|
||||
*.sublime-project
|
||||
|
22
config/custom_components/hello_world.py
Normal file
22
config/custom_components/hello_world.py
Normal file
@ -0,0 +1,22 @@
|
||||
"""
|
||||
custom_components.hello_world
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Implements the bare minimum that a component should implement.
|
||||
"""
|
||||
|
||||
# The domain of your component. Should be equal to the name of your component
|
||||
DOMAIN = "hello_world"
|
||||
|
||||
# List of component names (string) your component depends upon
|
||||
DEPENDENCIES = []
|
||||
|
||||
|
||||
def setup(hass, config):
|
||||
""" Setup our skeleton component. """
|
||||
|
||||
# States are in the format DOMAIN.OBJECT_ID
|
||||
hass.states.set('hello_world.Hello_World', 'Works!')
|
||||
|
||||
# return boolean to indicate that initialization was successful
|
||||
return True
|
Loading…
x
Reference in New Issue
Block a user