Coder Social home page Coder Social logo

limych / ha-blueprint Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 4.0 911 KB

Home Assistant Component blueprint

License: Other

Shell 37.29% Python 59.55% Dockerfile 0.49% Makefile 2.67%
homeassistant home-assistant integration blueprint component home-assistant-component

ha-blueprint's Introduction

Please ⭐ this repo if you find it useful

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.

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 is an extension and addition to the integration_blueprint repository. It is regularly updated with all the edits from parent repository and makes it easy to apply new edits to your project. This way you can easily keep it up to date.

This repository contains multiple files, here is a overview:

File Purpose  Documentation
.devcontainer.json Used for development/testing with Visual Studio Code. Documentation
.github/ISSUE_TEMPLATE/*.yml Templates for the issue tracker Documentation
.vscode/tasks.json Tasks for the devcontainer. Documentation
custom_components/integration_blueprint/* Integration files, this is where everything happens. Documentation
tests/* Integration unit tests.
CONTRIBUTING.md Guidelines on how to contribute. Documentation
LICENSE The license file for the project. Documentation
README.md The file you are reading now, should contain info about the integration, installation and configuration instructions. Documentation
requirements.txt Python packages used for development/lint/testing this integration. Documentation

How?

  • …or use this template to create your new repository. Then download a copy of the new repository to your IDE and run the final environment setup commands:

    # Configure future updates from blueprint repository
    git remote add blueprint https://github.com/Limych/ha-blueprint.git
    git fetch blueprint dev
    git merge blueprint/dev --allow-unrelated-histories
    
    # Push changes to origin repository
    git push -u origin dev
    
    # Initialize the development environment
    ./scripts/setup
  • …or create a new repository on the command line:

    # Initialize your new origin repository
    git init
    git remote add origin https://github.com/YOUR_NEW_REPOSITORY
    
    # Apply blueprint repository
    git remote add blueprint https://github.com/Limych/ha-blueprint.git
    git fetch blueprint dev
    git reset --hard blueprint/dev
    git branch -M dev
    
    # Push changes to origin repository
    git push -u origin dev
    
    # Initialize the development environment
    ./scripts/setup
  • …or apply blueprint to an existing repository from the command line:

    # Apply blueprint repository
    git remote add blueprint https://github.com/Limych/ha-blueprint.git
    git fetch blueprint dev
    git merge blueprint/dev --allow-unrelated-histories
    
    # Push changes to origin repository
    git push -u origin dev
    
    # Initialize the development environment
    ./scripts/setup

After these steps, your repository will developing on a own branch. But in parallel there will be this blueprint repository, new changes in which you can always apply with a couple of simple commands:

./scripts/update
git merge blueprint/dev

Then:

  1. Rename all instances of the integration_blueprint to custom_components/<your_integration_domain> (e.g. custom_components/awesome_integration).
  2. Rename all instances of the Integration Blueprint to <Your Integration Name> (e.g. Awesome Integration).

If you need to work on the python library in parallel of this integration (sampleclient in this example) there are different options. The following one seems easy to implement:

  • Create a dedicated branch for your python library on a public git repository (example: branch dev on https://github.com/ludeeus/sampleclient)
  • Update in the manifest.json file the requirements key to point on your development branch ( example: "requirements": ["git+https://github.com/ludeeus/sampleclient.git@dev#devp==0.0.1beta1"])
  • Each time you need to make a modification to your python library, push it to your development branch and increase the number of the python library version in manifest.json file to ensure Home Assistant update the code of the python library. (example "requirements": ["git+https://...==0.0.1beta2"]).

Next steps

These are some next steps you may want to look into:

ha-blueprint's People

Contributors

antonverburg avatar ctso avatar dependabot[bot] avatar eifinger avatar eseglem avatar github-actions[bot] avatar iantrich avatar jcgoette avatar limych avatar linushoppe avatar ludeeus avatar matthewflamm avatar mattrayner avatar misa1515 avatar mjmeli avatar myztillx avatar oncleben31 avatar raman325 avatar rianoc avatar rodpayne avatar rroller avatar salem84 avatar scottg489 avatar swartjean avatar tefinger avatar tetienne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ha-blueprint's Issues

Rename to my_custom_component

What am I missing? How do I use this blueprint to create my own component? Do I need to do a global string replace?
Thanks
R

No Release Notes for Last Two Updates

There have been no release notes for the last two updates. I don't typically update integrations that provide no information on why the update is needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.