mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-10 02:46:29 +00:00
Embedded platforms (#205)
* Update example to follow the embedded structure * Update example to follow the embedded structure
This commit is contained in:
parent
28cf775d53
commit
fe43a10d9b
@ -4,7 +4,7 @@ title: "Example light platform"
|
||||
|
||||
This example is for adding support for the imaginary Awesome Lights. It shows the different best practices for developing a platform.
|
||||
|
||||
Similar to Example Sensor Platform, copy the code below, and create it as a file in `<config_dir>/custom_components/light/awesomelights.py`.
|
||||
Similar to Example Sensor Platform, copy the code below, and create it as a file in `<config_dir>/custom_components/awesomelights/light.py`.
|
||||
|
||||
Add the following to your configuration.yaml:
|
||||
|
||||
@ -16,7 +16,7 @@ light:
|
||||
password: PASSWORD_HERE_OR_secrets.yaml
|
||||
```
|
||||
|
||||
Note the `platform` name matches the filename for the source code.
|
||||
Note the `platform` name matches the directory name that contains the source code.
|
||||
|
||||
```python
|
||||
import logging
|
||||
|
@ -6,7 +6,7 @@ This is a minimum implementation of a platform for the sensor component.
|
||||
|
||||
### Installation
|
||||
|
||||
Copy the code below and create it as a file in `<config_dir>/custom_components/sensor/example.py`.
|
||||
Copy the code below and create it as a file in `<config_dir>/custom_components/example/sensor.py`.
|
||||
|
||||
Add the following to your `configuration.yaml` file:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user