diff --git a/cookbook/python_component_mqtt_basic/index.html b/cookbook/python_component_mqtt_basic/index.html
index 10c68f3b05..8caca0a474 100644
--- a/cookbook/python_component_mqtt_basic/index.html
+++ b/cookbook/python_component_mqtt_basic/index.html
@@ -140,12 +140,6 @@ This example requires you to have the MQTT component
diff --git a/developers/architecture_components/index.html b/developers/architecture_components/index.html
index ea3796868b..5712e1bc69 100644
--- a/developers/architecture_components/index.html
+++ b/developers/architecture_components/index.html
@@ -126,6 +126,16 @@ Diagram showing interaction between components and the Home Assistant core
Home Assistant allows components and platforms to specify their dependencies and requirements using the variables DEPENDENCIES and REQUIREMENTS. Both are lists that contain strings.
-
Dependencies
+
Dependencies
Dependencies are other Home Assistant components that should be setup before the platform is loaded. An example is the MQTT sensor component, which requires an active connection to an MQTT broker. If Home Assistant is unable to load and setup the MQTT component, it will not setup the MQTT sensor component.
DEPENDENCIES=['mqtt']
-
Requirements
+
Requirements
Requirements are Python libraries that you would normally install using pip for your component. Home Assistant will try to install the requirements into the deps subdirectory of the Home Assistant configuration directory (.home-assistant by default) or verify it is already installed at startup. If that fails, the component will fail to load.
Requirements is a list of strings. Each entry is a pip compatible string. For example, the media player Cast platform depends on the Python package PyChromecast v0.6.12:
diff --git a/developers/component_discovery/index.html b/developers/component_discovery/index.html
index 68f40d6cb5..62581bf4d6 100644
--- a/developers/component_discovery/index.html
+++ b/developers/component_discovery/index.html
@@ -118,6 +118,16 @@ This option is only available for built-in components.
diff --git a/developers/component_generic_discovery/index.html b/developers/component_generic_discovery/index.html
index 33b3126974..ee04911fd3 100644
--- a/developers/component_generic_discovery/index.html
+++ b/developers/component_generic_discovery/index.html
@@ -145,6 +145,16 @@ This can be achieved using the load_platformValidation
diff --git a/developers/component_loading/index.html b/developers/component_loading/index.html
index 88753180e2..7f39ada339 100644
--- a/developers/component_loading/index.html
+++ b/developers/component_loading/index.html
@@ -106,6 +106,16 @@ Home Assistant will use the directory that contains your config file as the dire
diff --git a/developers/component_visibility/index.html b/developers/component_visibility/index.html
index fec20d6c83..5caf13ad78 100644
--- a/developers/component_visibility/index.html
+++ b/developers/component_visibility/index.html
@@ -101,6 +101,16 @@ You can set a suggestion for your entity’s visibility by setting the Validation
The goal of development 101 is to get you familiar with the basics of developing for Home Assistant. Before we start, please make sure you familiarize yourself with the architecture.
+
To get our code running inside Home Assistant we’re going to create a custom component. The first step is to locate your config folder. You can find the path to your config folder by opening the Home Assistant frontend, click on the . It’s the path after the text “Path to configuration.yaml”.
+
Inside your configuration directory create a new folder called custom_components. It might be that one already exists, that’s fine too. This is the folder that Home Assistant will look at when looking for custom code.
+
+The Home Assistant API has two variants: a synchronous and an asynchronous version (asyncio). This development course will focus on the synchronous version.
+
+
To verify that everything is working correctly, let’s create a small Hello World component. To do so, create a file called hello_world.py in your custom components folder. Copy paste the following content to it:
+
# The domain of your component. Equal to the filename of your component.
+DOMAIN="hello_world"
+
+
+defsetup(hass,config):
+ """Setup the hello_world component."""
+ # States are in the format DOMAIN.OBJECT_ID.
+ hass.states.set('hello_world.Hello_World','Works!')
+
+ # Return boolean to indicate that initialization was successfully.
+ returnTrue
+
diff --git a/developers/component_initialization/index.html b/developers/development_config/index.html
similarity index 76%
rename from developers/component_initialization/index.html
rename to developers/development_config/index.html
index e7d4504cf2..fb99183668 100644
--- a/developers/component_initialization/index.html
+++ b/developers/development_config/index.html
@@ -6,22 +6,22 @@
- Initializing your components - Home Assistant
+ Using Config - Home Assistant
-
+
-
+
-
+
-
+
-
+
-
-
+
+
@@ -62,53 +62,30 @@
- Initializing Your Components
+ Using Config
-
After loading, the bootstrapper will call setup(hass, config) method on the component to initialize it.
-
hass: the Home Assistant instance
-
The Home Assistant instance contains four objects to help you interact with the system.
-
-
-
-
Object
-
Description
-
-
-
-
-
hass.config
-
This is the core configuration of Home Assistant exposing location, temperature preferences and config directory path. Details
-
-
-
hass.states
-
This is the StateMachine. It allows you to set states and track when they are changed. See available methods.
-
-
-
hass.bus
-
This is the EventBus. It allows you to trigger and listen for events. See available methods.
-
-
-
hass.services
-
This is the ServiceRegistry. It allows you to register services. See available methods.
-
-
-
-
config: User given configuration.
-
The config parameter is a dictionary containing the user supplied configuration. The keys of the dictionary are the component names and the value is another dictionary with the component configuration.
+
Based on where you are in the code, config can mean various things.
+
On the hass object
+
On the hass object is an instance of the Config class. The Config class contains the users preferred units, the path to the config directory and which components are loaded. See available methods.
+
Config passed into component setup
+
The config parameter passed to a component setup is a dictionary containing all of the user supplied configuration. The keys of the dictionary are the component names and the value is another dictionary with the component configuration.
+
The object will have already been validated using your CONFIG_SCHEMA or PLATFORM_SCHEMA if available. If you have defined a PLATFORM_SCHEMA, all references to your component (ie light 2: etc) will have been changed to be accessible as a list under config[DOMAIN].
If your configuration file contains the following lines:
example:host:paulusschoutsen.nl
Then in the setup method of your component you will be able to refer to config['example']['host'] to get the value paulusschoutsen.nl.
+
Passed into platform setup
+
The config parameter passed to a platform setup function is only the config for that specific platform.