1
0

Compare commits

...

33 Commits

15 changed files with 74 additions and 103 deletions

Submodule .github/ISSUE_TEMPLATE/feature-requests added at 57ae0cb009

View File

@@ -1,12 +1,22 @@
name: Lint name: Lint
on: [push, pull_request] on:
push:
branches:
- main
pull_request:
jobs: jobs:
build: build:
name: Add-on configuration name: Add-on configuration
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
channel: [esphome, esphome-beta, esphome-dev] channels:
- folder: esphome
channel: stable
- folder: esphome-beta
channel: beta
- folder: esphome-dev
channel: dev
steps: steps:
- name: ⤵️ Check out code from GitHub - name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2 uses: actions/checkout@v2
@@ -17,8 +27,8 @@ jobs:
- name: 🛠 Install dependencies - name: 🛠 Install dependencies
run: pip install -r script/requirements.txt run: pip install -r script/requirements.txt
- name: 🛠 Generate files from template - name: 🛠 Generate files from template
run: python script/generate.py dev beta stable run: python script/generate.py ${{ matrix.channels.channel }}
- name: 🚀 Run Home Assistant Add-on Lint on ${{ matrix.channel }} - name: 🚀 Run Home Assistant Add-on Lint on ${{ matrix.channels.channel }}
uses: frenck/action-addon-linter@v2 uses: frenck/action-addon-linter@v2
with: with:
path: "./${{ matrix.channel }}" path: "./${{ matrix.channels.folder }}"

View File

@@ -51,15 +51,6 @@ The private key file to use for SSL. If this file doesn't exist, the add-on star
Adding this option to the add-on configuration allows you to disable Adding this option to the add-on configuration allows you to disable
authentication by setting it to `true`. authentication by setting it to `true`.
### Option: `esphome_version`
Manually override which ESPHome version to use in the add-on.
For example to install the latest development version, use `"esphome_version": "dev"`,
or for version 1.14.0: `"esphome_version": "v1.14.0""`.
Please note that this does not always work and is only meant for testing, usually the
ESPHome add-on and dashboard version must match to guarantee a working system.
### Option: `relative_url` ### Option: `relative_url`
Host the ESPHome dashboard under a relative URL, so that it can be integrated Host the ESPHome dashboard under a relative URL, so that it can be integrated

View File

@@ -1,6 +1,6 @@
# ESPHome Home Assistant Add-On # ESPHome Home Assistant Add-On
[![ESPHome logo](https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/logo.png)](https://esphome.io/) [![ESPHome logo](https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/logo.png)](https://esphome.io/)
[![GitHub stars](https://img.shields.io/github/stars/esphome/esphome.svg?style=social&label=Star&maxAge=2592000)](https://github.com/esphome/esphome) [![GitHub stars](https://img.shields.io/github/stars/esphome/esphome.svg?style=social&label=Star&maxAge=2592000)](https://github.com/esphome/esphome)
[![GitHub Release][releases-shield]][releases] [![GitHub Release][releases-shield]][releases]
@@ -14,7 +14,7 @@ is write YAML configuration files; the rest (over-the-air updates, compiling) is
handled by ESPHome. handled by ESPHome.
<p align="center"> <p align="center">
<img title="ESPHome dashboard screenshot" src="https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/images/screenshot.png" width="700px"></img> <img title="ESPHome dashboard screenshot" src="https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/images/screenshot.png" width="700px"></img>
</p> </p>
[View the ESPHome documentation](https://esphome.io/) [View the ESPHome documentation](https://esphome.io/)
@@ -26,11 +26,11 @@ firmware. For example, to include a [DHT22][dht22].
temperature and humidity sensor, you just need to include 8 lines of YAML temperature and humidity sensor, you just need to include 8 lines of YAML
in your configuration file: in your configuration file:
<img title="ESPHome DHT configuration example" src="https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/images/dht-example.png" width="500px"></img> <img title="ESPHome DHT configuration example" src="https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/images/dht-example.png" width="500px"></img>
Then just click UPLOAD and the sensor will magically appear in Home Assistant: Then just click UPLOAD and the sensor will magically appear in Home Assistant:
<img title="ESPHome Home Assistant MQTT discovery" src="https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/images/temperature-humidity.png" width="600px"></img> <img title="ESPHome Home Assistant MQTT discovery" src="https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/images/temperature-humidity.png" width="600px"></img>
[discord-shield]: https://img.shields.io/discord/429907082951524364.svg [discord-shield]: https://img.shields.io/discord/429907082951524364.svg
[dht22]: https://esphome.io/components/sensor/dht.html [dht22]: https://esphome.io/components/sensor/dht.html

View File

@@ -5,6 +5,9 @@
"aarch64" "aarch64"
], ],
"auth_api": true, "auth_api": true,
"backup_exclude": [
"*/*/"
],
"description": "Beta version of ESPHome add-on", "description": "Beta version of ESPHome add-on",
"hassio_api": true, "hassio_api": true,
"host_network": true, "host_network": true,
@@ -25,7 +28,6 @@
}, },
"schema": { "schema": {
"certfile": "str?", "certfile": "str?",
"esphome_version": "str?",
"keyfile": "str?", "keyfile": "str?",
"leave_front_door_open": "bool?", "leave_front_door_open": "bool?",
"relative_url": "str?", "relative_url": "str?",
@@ -34,11 +36,8 @@
"streamer_mode": "bool?" "streamer_mode": "bool?"
}, },
"slug": "esphome-beta", "slug": "esphome-beta",
"snapshot_exclude": [
"*/*/"
],
"stage": "experimental", "stage": "experimental",
"uart": true, "uart": true,
"url": "https://beta.esphome.io/", "url": "https://beta.esphome.io/",
"version": "1.19.2" "version": "2021.9.0"
} }

View File

@@ -51,15 +51,6 @@ The private key file to use for SSL. If this file doesn't exist, the add-on star
Adding this option to the add-on configuration allows you to disable Adding this option to the add-on configuration allows you to disable
authentication by setting it to `true`. authentication by setting it to `true`.
### Option: `esphome_version`
Manually override which ESPHome version to use in the add-on.
For example to install the latest development version, use `"esphome_version": "dev"`,
or for version 1.14.0: `"esphome_version": "v1.14.0""`.
Please note that this does not always work and is only meant for testing, usually the
ESPHome add-on and dashboard version must match to guarantee a working system.
### Option: `relative_url` ### Option: `relative_url`
Host the ESPHome dashboard under a relative URL, so that it can be integrated Host the ESPHome dashboard under a relative URL, so that it can be integrated

View File

@@ -1,6 +1,6 @@
# ESPHome Home Assistant Add-On # ESPHome Home Assistant Add-On
[![ESPHome logo](https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/logo.png)](https://esphome.io/) [![ESPHome logo](https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/logo.png)](https://esphome.io/)
[![GitHub stars](https://img.shields.io/github/stars/esphome/esphome.svg?style=social&label=Star&maxAge=2592000)](https://github.com/esphome/esphome) [![GitHub stars](https://img.shields.io/github/stars/esphome/esphome.svg?style=social&label=Star&maxAge=2592000)](https://github.com/esphome/esphome)
[![GitHub Release][releases-shield]][releases] [![GitHub Release][releases-shield]][releases]
@@ -14,7 +14,7 @@ is write YAML configuration files; the rest (over-the-air updates, compiling) is
handled by ESPHome. handled by ESPHome.
<p align="center"> <p align="center">
<img title="ESPHome dashboard screenshot" src="https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/images/screenshot.png" width="700px"></img> <img title="ESPHome dashboard screenshot" src="https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/images/screenshot.png" width="700px"></img>
</p> </p>
[View the ESPHome documentation](https://esphome.io/) [View the ESPHome documentation](https://esphome.io/)
@@ -26,11 +26,11 @@ firmware. For example, to include a [DHT22][dht22].
temperature and humidity sensor, you just need to include 8 lines of YAML temperature and humidity sensor, you just need to include 8 lines of YAML
in your configuration file: in your configuration file:
<img title="ESPHome DHT configuration example" src="https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/images/dht-example.png" width="500px"></img> <img title="ESPHome DHT configuration example" src="https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/images/dht-example.png" width="500px"></img>
Then just click UPLOAD and the sensor will magically appear in Home Assistant: Then just click UPLOAD and the sensor will magically appear in Home Assistant:
<img title="ESPHome Home Assistant MQTT discovery" src="https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/images/temperature-humidity.png" width="600px"></img> <img title="ESPHome Home Assistant MQTT discovery" src="https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/images/temperature-humidity.png" width="600px"></img>
[discord-shield]: https://img.shields.io/discord/429907082951524364.svg [discord-shield]: https://img.shields.io/discord/429907082951524364.svg
[dht22]: https://esphome.io/components/sensor/dht.html [dht22]: https://esphome.io/components/sensor/dht.html

View File

@@ -5,7 +5,10 @@
"aarch64" "aarch64"
], ],
"auth_api": true, "auth_api": true,
"description": "Development Version! Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files", "backup_exclude": [
"*/*/"
],
"description": "Development version of ESPHome add-on",
"hassio_api": true, "hassio_api": true,
"host_network": true, "host_network": true,
"ingress": true, "ingress": true,
@@ -15,19 +18,15 @@
"config:rw" "config:rw"
], ],
"name": "ESPHome (dev)", "name": "ESPHome (dev)",
"options": {
"esphome_version": "dev"
},
"panel_icon": "mdi:chip", "panel_icon": "mdi:chip",
"ports": { "ports": {
"6052/tcp": null "6052/tcp": null
}, },
"ports_description": { "ports_description": {
"6052/tcp": "Web interface (Not required for Home Assistant Ingress)" "6052/tcp": "Web interface (not required for Home Assistant ingress)"
}, },
"schema": { "schema": {
"certfile": "str?", "certfile": "str?",
"esphome_version": "str?",
"keyfile": "str?", "keyfile": "str?",
"leave_front_door_open": "bool?", "leave_front_door_open": "bool?",
"relative_url": "str?", "relative_url": "str?",
@@ -36,9 +35,6 @@
"streamer_mode": "bool?" "streamer_mode": "bool?"
}, },
"slug": "esphome-dev", "slug": "esphome-dev",
"snapshot_exclude": [
"*/*/"
],
"stage": "experimental", "stage": "experimental",
"uart": true, "uart": true,
"url": "https://next.esphome.io/", "url": "https://next.esphome.io/",

View File

@@ -51,15 +51,6 @@ The private key file to use for SSL. If this file doesn't exist, the add-on star
Adding this option to the add-on configuration allows you to disable Adding this option to the add-on configuration allows you to disable
authentication by setting it to `true`. authentication by setting it to `true`.
### Option: `esphome_version`
Manually override which ESPHome version to use in the add-on.
For example to install the latest development version, use `"esphome_version": "dev"`,
or for version 1.14.0: `"esphome_version": "v1.14.0""`.
Please note that this does not always work and is only meant for testing, usually the
ESPHome add-on and dashboard version must match to guarantee a working system.
### Option: `relative_url` ### Option: `relative_url`
Host the ESPHome dashboard under a relative URL, so that it can be integrated Host the ESPHome dashboard under a relative URL, so that it can be integrated

View File

@@ -1,6 +1,6 @@
# ESPHome Home Assistant Add-On # ESPHome Home Assistant Add-On
[![ESPHome logo](https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/logo.png)](https://esphome.io/) [![ESPHome logo](https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/logo.png)](https://esphome.io/)
[![GitHub stars](https://img.shields.io/github/stars/esphome/esphome.svg?style=social&label=Star&maxAge=2592000)](https://github.com/esphome/esphome) [![GitHub stars](https://img.shields.io/github/stars/esphome/esphome.svg?style=social&label=Star&maxAge=2592000)](https://github.com/esphome/esphome)
[![GitHub Release][releases-shield]][releases] [![GitHub Release][releases-shield]][releases]
@@ -14,7 +14,7 @@ is write YAML configuration files; the rest (over-the-air updates, compiling) is
handled by ESPHome. handled by ESPHome.
<p align="center"> <p align="center">
<img title="ESPHome dashboard screenshot" src="https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/images/screenshot.png" width="700px"></img> <img title="ESPHome dashboard screenshot" src="https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/images/screenshot.png" width="700px"></img>
</p> </p>
[View the ESPHome documentation](https://esphome.io/) [View the ESPHome documentation](https://esphome.io/)
@@ -26,11 +26,11 @@ firmware. For example, to include a [DHT22][dht22].
temperature and humidity sensor, you just need to include 8 lines of YAML temperature and humidity sensor, you just need to include 8 lines of YAML
in your configuration file: in your configuration file:
<img title="ESPHome DHT configuration example" src="https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/images/dht-example.png" width="500px"></img> <img title="ESPHome DHT configuration example" src="https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/images/dht-example.png" width="500px"></img>
Then just click UPLOAD and the sensor will magically appear in Home Assistant: Then just click UPLOAD and the sensor will magically appear in Home Assistant:
<img title="ESPHome Home Assistant MQTT discovery" src="https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/images/temperature-humidity.png" width="600px"></img> <img title="ESPHome Home Assistant MQTT discovery" src="https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/images/temperature-humidity.png" width="600px"></img>
[discord-shield]: https://img.shields.io/discord/429907082951524364.svg [discord-shield]: https://img.shields.io/discord/429907082951524364.svg
[dht22]: https://esphome.io/components/sensor/dht.html [dht22]: https://esphome.io/components/sensor/dht.html

View File

@@ -5,6 +5,9 @@
"aarch64" "aarch64"
], ],
"auth_api": true, "auth_api": true,
"backup_exclude": [
"*/*/"
],
"description": "ESPHome add-on for intelligently managing all your ESP8266/ESP32 devices", "description": "ESPHome add-on for intelligently managing all your ESP8266/ESP32 devices",
"hassio_api": true, "hassio_api": true,
"host_network": true, "host_network": true,
@@ -25,7 +28,6 @@
}, },
"schema": { "schema": {
"certfile": "str?", "certfile": "str?",
"esphome_version": "str?",
"keyfile": "str?", "keyfile": "str?",
"leave_front_door_open": "bool?", "leave_front_door_open": "bool?",
"relative_url": "str?", "relative_url": "str?",
@@ -34,10 +36,7 @@
"streamer_mode": "bool?" "streamer_mode": "bool?"
}, },
"slug": "esphome", "slug": "esphome",
"snapshot_exclude": [
"*/*/"
],
"uart": true, "uart": true,
"url": "https://esphome.io/", "url": "https://esphome.io/",
"version": "1.19.2" "version": "2021.9.0"
} }

View File

@@ -8,50 +8,55 @@ import json
from shutil import copyfile from shutil import copyfile
import sys import sys
class Channel(Enum): class Channel(Enum):
stable = 'stable' stable = "stable"
beta = 'beta' beta = "beta"
dev = 'dev' dev = "dev"
def main(args): def main(args):
parser = argparse.ArgumentParser(description='Generate ESPHome Home Assistant config.json') parser = argparse.ArgumentParser(
parser.add_argument('channels', nargs='+', type=Channel, choices=list(Channel)) description="Generate ESPHome Home Assistant config.json"
)
parser.add_argument("channels", nargs="+", type=Channel, choices=list(Channel))
args = parser.parse_args(args) args = parser.parse_args(args)
root = Path(__file__).parent.parent root = Path(__file__).parent.parent
templ = root / 'template' templ = root / "template"
with open(templ / "addon_config.yaml", 'r') as f: with open(templ / "addon_config.yaml", "r") as f:
config = yaml.safe_load(f) config = yaml.safe_load(f)
copyf = config['copy_files'] copyf = config["copy_files"]
for channel in args.channels: for channel in args.channels:
conf = config[f'esphome-{channel.value}'] conf = config[f"esphome-{channel.value}"]
base_image = conf.pop('base_image') base_image = conf.pop("base_image")
dir_ = root / conf.pop('directory') dir_ = root / conf.pop("directory")
path = dir_ / 'config.json' path = dir_ / "config.json"
with open(path, 'w') as f: with open(path, "w") as f:
json.dump(conf, f, indent=2, sort_keys=True) json.dump(conf, f, indent=2, sort_keys=True)
for file_, conf_ in copyf.items(): for file_, conf_ in copyf.items():
copyfile(templ / file_, dir_ / file_) copyfile(templ / file_, dir_ / file_)
path = dir_ / 'FILES ARE GENERATED DO NOT EDIT' path = dir_ / "FILES ARE GENERATED DO NOT EDIT"
with open(path, 'w') as f: with open(path, "w") as f:
f.write("Any edits should be made to the files in the 'template' directory") f.write("Any edits should be made to the files in the 'template' directory")
if channel == Channel.dev: if channel == Channel.dev:
path = dir_ / 'build.json' path = dir_ / "build.json"
build_conf = { build_conf = {
"build_from": {arch: base_image.format(arch=arch) for arch in conf['arch']} "build_from": {
arch: base_image.format(arch=arch) for arch in conf["arch"]
}
} }
with open(path, 'w') as f: with open(path, "w") as f:
json.dump(build_conf, f, indent=2, sort_keys=True) json.dump(build_conf, f, indent=2, sort_keys=True)
print(f"Wrote {path}") print(f"Wrote {path}")
if __name__ == '__main__': if __name__ == "__main__":
main(sys.argv[1:]) main(sys.argv[1:])

View File

@@ -51,15 +51,6 @@ The private key file to use for SSL. If this file doesn't exist, the add-on star
Adding this option to the add-on configuration allows you to disable Adding this option to the add-on configuration allows you to disable
authentication by setting it to `true`. authentication by setting it to `true`.
### Option: `esphome_version`
Manually override which ESPHome version to use in the add-on.
For example to install the latest development version, use `"esphome_version": "dev"`,
or for version 1.14.0: `"esphome_version": "v1.14.0""`.
Please note that this does not always work and is only meant for testing, usually the
ESPHome add-on and dashboard version must match to guarantee a working system.
### Option: `relative_url` ### Option: `relative_url`
Host the ESPHome dashboard under a relative URL, so that it can be integrated Host the ESPHome dashboard under a relative URL, so that it can be integrated

View File

@@ -1,6 +1,6 @@
# ESPHome Home Assistant Add-On # ESPHome Home Assistant Add-On
[![ESPHome logo](https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/logo.png)](https://esphome.io/) [![ESPHome logo](https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/logo.png)](https://esphome.io/)
[![GitHub stars](https://img.shields.io/github/stars/esphome/esphome.svg?style=social&label=Star&maxAge=2592000)](https://github.com/esphome/esphome) [![GitHub stars](https://img.shields.io/github/stars/esphome/esphome.svg?style=social&label=Star&maxAge=2592000)](https://github.com/esphome/esphome)
[![GitHub Release][releases-shield]][releases] [![GitHub Release][releases-shield]][releases]
@@ -14,7 +14,7 @@ is write YAML configuration files; the rest (over-the-air updates, compiling) is
handled by ESPHome. handled by ESPHome.
<p align="center"> <p align="center">
<img title="ESPHome dashboard screenshot" src="https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/images/screenshot.png" width="700px"></img> <img title="ESPHome dashboard screenshot" src="https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/images/screenshot.png" width="700px"></img>
</p> </p>
[View the ESPHome documentation](https://esphome.io/) [View the ESPHome documentation](https://esphome.io/)
@@ -26,11 +26,11 @@ firmware. For example, to include a [DHT22][dht22].
temperature and humidity sensor, you just need to include 8 lines of YAML temperature and humidity sensor, you just need to include 8 lines of YAML
in your configuration file: in your configuration file:
<img title="ESPHome DHT configuration example" src="https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/images/dht-example.png" width="500px"></img> <img title="ESPHome DHT configuration example" src="https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/images/dht-example.png" width="500px"></img>
Then just click UPLOAD and the sensor will magically appear in Home Assistant: Then just click UPLOAD and the sensor will magically appear in Home Assistant:
<img title="ESPHome Home Assistant MQTT discovery" src="https://raw.githubusercontent.com/esphome/hassio/master/esphome-dev/images/temperature-humidity.png" width="600px"></img> <img title="ESPHome Home Assistant MQTT discovery" src="https://raw.githubusercontent.com/esphome/hassio/main/esphome-dev/images/temperature-humidity.png" width="600px"></img>
[discord-shield]: https://img.shields.io/discord/429907082951524364.svg [discord-shield]: https://img.shields.io/discord/429907082951524364.svg
[dht22]: https://esphome.io/components/sensor/dht.html [dht22]: https://esphome.io/components/sensor/dht.html

View File

@@ -1,6 +1,6 @@
--- ---
# When changing options in this file, please also run: # When changing options in this file, please also run:
# python3 script/generate.py dev # python3 script/generate.py dev
# to update the dev addon config (beta/stable configs will be updated on next release by release script) # to update the dev addon config (beta/stable configs will be updated on next release by release script)
base: &base base: &base
url: https://esphome.io/ url: https://esphome.io/
@@ -31,11 +31,10 @@ base: &base
certfile: str? certfile: str?
keyfile: str? keyfile: str?
leave_front_door_open: bool? leave_front_door_open: bool?
esphome_version: str?
streamer_mode: bool? streamer_mode: bool?
relative_url: str? relative_url: str?
status_use_ping: bool? status_use_ping: bool?
snapshot_exclude: backup_exclude:
- "*/*/" - "*/*/"
base_image: esphome/esphome-hassio-base-{arch}:3.1.0 base_image: esphome/esphome-hassio-base-{arch}:3.1.0
@@ -48,14 +47,12 @@ esphome-dev:
description: "Development version of ESPHome add-on" description: "Development version of ESPHome add-on"
url: https://next.esphome.io/ url: https://next.esphome.io/
stage: experimental stage: experimental
options:
esphome_version: dev
esphome-beta: esphome-beta:
<<: *base <<: *base
directory: esphome-beta directory: esphome-beta
name: ESPHome (beta) name: ESPHome (beta)
version: '1.19.2' # BETA version: '2021.9.0' # BETA
slug: esphome-beta slug: esphome-beta
description: "Beta version of ESPHome add-on" description: "Beta version of ESPHome add-on"
url: https://beta.esphome.io/ url: https://beta.esphome.io/
@@ -66,7 +63,7 @@ esphome-stable:
<<: *base <<: *base
directory: esphome directory: esphome
name: ESPHome name: ESPHome
version: '1.19.2' # STABLE version: '2021.9.0' # STABLE
slug: esphome slug: esphome
description: "ESPHome add-on for intelligently managing all your ESP8266/ESP32 devices" description: "ESPHome add-on for intelligently managing all your ESP8266/ESP32 devices"
image: esphome/esphome-hassio-{arch} image: esphome/esphome-hassio-{arch}