Bashio - Home Assistant Community Add-ons
Find a file
Franck Nijhof 4533f16649
Adds support for new Supervisor options (#10)
*  Adds support for new Supervisor options

* 👕 Make sure Supervisor debug calls are always retuning a boolean
2019-08-19 20:28:18 +02:00
.github Adds Probot configuration 2018-09-29 23:40:19 +02:00
lib Adds support for new Supervisor options (#10) 2019-08-19 20:28:18 +02:00
.editorconfig Adds repo basics 2018-09-29 23:42:24 +02:00
.gitignore Adds repo basics 2018-09-29 23:42:24 +02:00
.gitlab-ci.yml 🔨 Updates GitLab CI build script 2019-03-16 15:25:33 +01:00
.mdlrc Adds repo basics 2018-09-29 23:42:24 +02:00
.yamllint 🔨 Updates GitLab CI build script 2019-03-16 15:25:33 +01:00
CODE_OF_CONDUCT.md 📚 Adds basic documentation files 2018-09-29 23:42:55 +02:00
CONTRIBUTING.md 📚 Adds basic documentation files 2018-09-29 23:42:55 +02:00
LICENSE.md 🎉 Initial library code 2019-03-14 17:14:31 +01:00
README.md 🚑 Fixes broken link in README 2019-04-07 21:00:03 +02:00

Community Hass.io Add-ons: Bashio

GitHub Release Project Stage License

GitLab CI Project Maintenance GitHub Activity

Discord

Buy me a coffee

Support my work on Patreon

About

Bashio is an bash function library for use with Hass.io add-ons.

It contains a set of commonly used operations and can be used to be included in add-ons to reduce code duplication across add-ons and therefore making it easier to develop and maintain add-ons.

Main goals:

  • Reduce the number of operations needed in add-ons.
  • Reduce the amount of code needed in add-ons.
  • Make add-on code more readable.
  • Providing an trusted and tested code base.

Quicker add-on development, by allowing you to focus on the add-on logic instead of other things.

Installation

The library is installed in the Community Hass.io Add-ons base images and the official Hassio base images by Home Assistant.

Currently available base images:

Using those images as the base for your Hass.io add-on, will provide this function library out of the box. Our base images are updated frequently and provides the minimal needed base image for a great add-on.

If you want to add Bashio to your own images, please take a look at the Dockerfile of the above base images to see how they are added at build time.

Configuration

Configuring an Bash script to use the Bashio library is fairly easy. Simply replace the shebang of your script file, from bash to bashio.

Before example:

#!/usr/bin/env bash
set -e

CONFIG_PATH=/data/options.json

USERNAME=$(jq --raw-output '.username // empty' $CONFIG_PATH)

echo "${USERNAME}"

After example with Bashio:

#!/usr/bin/env bashio

USERNAME=$(bashio::config 'username')

bashio::log.info "${USERNAME}"

Functions

Bashio has more then 250+ functions available: communicating with the Hass.io API, Have I Been Pwned, file system, logging, configuration handling and a lot more!

The best way to get around, would be by looking at the different modules available in the lib folder. Each module has its own file, and each function has been documented inside the code base.

Further more, Bashio is used by the Community Hass.io Add-ons project, those add-ons will be a great resource of practical examples.

Known issues and limitations

  • Some parts of the Hass.io API are not implemented yet.

Changelog & Releases

This repository keeps a change log using GitHub's releases functionality. The format of the log is based on Keep a Changelog.

Releases are based on Semantic Versioning, and use the format of MAJOR.MINOR.PATCH. In a nutshell, the version will be incremented based on the following:

  • MAJOR: Incompatible or major changes.
  • MINOR: Backwards-compatible new features and enhancements.
  • PATCH: Backwards-compatible bugfixes and package updates.

Support

Got questions?

You have several options to get them answered:

Contributing

This is an active open-source project. We are always open to people who want to use the code or contribute to it.

We have set up a separate document containing our contribution guidelines.

Thank you for being involved! 😍

Authors & contributors

The original setup of this repository is by Franck Nijhof.

For a full list of all authors and contributors, check the contributor's page.

License

MIT License

Copyright (c) 2019 Franck Nijhof

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.