From df3ddea23c400be041dbde183224736ab036bd57 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 26 Dec 2014 22:58:58 -0800 Subject: [PATCH] Added an example component that does the bare minimum --- .gitignore | 1 + config/custom_components/hello_world.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 config/custom_components/hello_world.py diff --git a/.gitignore b/.gitignore index ec8fbb301ae..fc7e301a093 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/config/custom_components/hello_world.py b/config/custom_components/hello_world.py new file mode 100644 index 00000000000..be1b935c8ad --- /dev/null +++ b/config/custom_components/hello_world.py @@ -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