Skip to content

skal88/blueprint

 
 

Repository files navigation

Notice

The component and platforms in this repository are not meant to be used by a user, but as a "blueprint" that custom component developers can build upon, to make more awesome stuff.

This blueprint uses 'sampleclient' to simulate what you actually might use in your integration.

HAVE FUN! 😎

Why?

This is simple, by having custom_components look (README + structure) the same it is easier for developers to help each other and for users to start using them.

If you are a developer and you want to add things to this "blueprint" that you think more developers will have use for, please open a PR to add it :)

What?

This repository contains multiple files, here is a overview:

File Purpose
.devcontainer/* Used for development/testing with VSCODE, more info in the readme file in that dir.
.github/ISSUE_TEMPLATE/feature_request.md Template for Feature Requests
.github/ISSUE_TEMPLATE/issue.md Template for issues
.github/settings.yml Probot settings to control the repository settings.
.vscode/tasks.json Tasks for the devcontainer.
custom_components/blueprint/.translations/* Translation files.
custom_components/blueprint/__init__.py The component file for the integration.
custom_components/blueprint/binary_sensor.py Binary sensor platform for the integration.
custom_components/blueprint/config_flow.py Config flow file, this adds the UI configuration possibilities.
custom_components/blueprint/const.py A file to hold shared variables/constants for the entire integration.
custom_components/blueprint/manifest.json A manifest file for Home Assistant.
custom_components/blueprint/sensor.py Sensor platform for the integration.
custom_components/blueprint/switch.py Switch sensor platform for the integration.
CONTRIBUTING.md Guidelines on how to contribute.
example.png Screenshot that demonstrate how it might look in the UI.
info.md An example on a info file (used by hacs).
LICENSE The license file for the project.
README.md The file you are reading now, should contain info about the integration, installation and configuration instructions.
requirements.txt Python packages used by this integration.

README content if this was a published component:


blueprint

GitHub Release GitHub Activity License

hacs Project Maintenance BuyMeCoffee

Discord Community Forum

Component to integrate with blueprint.

This component will set up the following platforms.

Platform Description
binary_sensor Show something True or False.
sensor Show info from blueprint API.
switch Switch something True or False.

example

Installation

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called blueprint.
  4. Download all the files from the custom_components/blueprint/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. Choose:
    • Add blueprint: to your HA configuration.
    • In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Blueprint"

Using your HA configuration directory (folder) as a starting point you should now also have this:

custom_components/blueprint/.translations/en.json
custom_components/blueprint/.translations/nb.json
custom_components/blueprint/.translations/sensor.nb.json
custom_components/blueprint/__init__.py
custom_components/blueprint/binary_sensor.py
custom_components/blueprint/config_flow.py
custom_components/blueprint/const.py
custom_components/blueprint/manifest.json
custom_components/blueprint/sensor.py
custom_components/blueprint/switch.py

Example configuration.yaml

blueprint:
  username: my_username
  password: my_password
  binary_sensor:
    - enabled: true
      name: My custom name
  sensor:
    - enabled: true
      name: My custom name
  switch:
    - enabled: true
      name: My custom name

Configuration options

Key Type Required Description
username string False Username for the client.
password string False Password for the client.
binary_sensor list False Configuration for the binary_sensor platform.
sensor list False Configuration for the sensor platform.
switch list False Configuration for the switch platform.

Configuration options for binary_sensor list

Key Type Required Default Description
enabled boolean False True Boolean to enable/disable the platform.
name string False blueprint Custom name for the entity.

Configuration options for sensor list

Key Type Required Default Description
enabled boolean False True Boolean to enable/disable the platform.
name string False blueprint Custom name for the entity.

Configuration options for switch list

Key Type Required Default Description
enabled boolean False True Boolean to enable/disable the platform.
name string False blueprint Custom name for the entity.

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines


About

Blueprint for custom_component developers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 93.8%
  • Shell 3.9%
  • Dockerfile 2.3%