Updated documentation
This commit is contained in:
parent
6164895bc9
commit
1ce48ece10
3 changed files with 182 additions and 113 deletions
|
@ -5,7 +5,11 @@ custom_components.example
|
|||
Bare minimum what is needed for a component to be valid.
|
||||
"""
|
||||
|
||||
# The domain of your component. Should be equal to the name of your component
|
||||
DOMAIN = "example"
|
||||
|
||||
# List of component names (string) your component depends upon
|
||||
# If you are setting up a group but not using a group for anything, don't depend on group
|
||||
DEPENDENCIES = []
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
|
@ -13,13 +17,14 @@ def setup(hass, config):
|
|||
""" Register services or listen for events that your component needs. """
|
||||
|
||||
# Example of a service that prints the service call to the command-line.
|
||||
hass.services.register(DOMAIN, "service_name", print)
|
||||
hass.services.register(DOMAIN, "example_service_name", print)
|
||||
|
||||
# This prints a time change event to the command-line twice a minute.
|
||||
hass.track_time_change(print, second=[0, 30])
|
||||
|
||||
# See also:
|
||||
# See also (defined in homeassistant/__init__.py):
|
||||
# hass.track_state_change
|
||||
# hass.track_point_in_time
|
||||
|
||||
# Tells the bootstrapper that the component was succesfully initialized
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue