mirror of
https://github.com/esphome/esphome.git
synced 2024-11-24 12:06:26 +01:00
Rename esphomeyaml to esphome (#426)
* Rename * Update * Add migration * Fix * Fix dashboard * Change test * Fixes * Code cleanup * Fix import order * Update * Automate docker builds * Shellcheck
This commit is contained in:
parent
1b8d242505
commit
3d9301a0f7
49
.github/ISSUE_TEMPLATE/bug_report.md
vendored
49
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,49 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help esphomelib improve
|
||||
|
||||
---
|
||||
|
||||
<!-- Thanks for reporting a bug for this project. READ THIS FIRST:
|
||||
- Please make sure to submit issues in the right GitHub repository, if unsure just post it here:
|
||||
- esphomeyaml [here] - This is mostly for reporting bugs when compiling and when you get a long stack trace while compiling or if a configuration fails to validate.
|
||||
- esphomelib [https://github.com/OttoWinter/esphomelib] - Report bugs there if the ESP is crashing or a feature is not working as expected.
|
||||
- esphomedocs [https://github.com/OttoWinter/esphomedocs] - Report bugs there if the documentation is wrong/outdated.
|
||||
- Provide as many details as possible. Paste logs, configuration sample and code into the backticks (```).
|
||||
|
||||
DO NOT DELETE ANY TEXT from this template! Otherwise the issue may be closed without a comment.
|
||||
-->
|
||||
|
||||
**Operating environment (Hass.io/Docker/pip/etc.):**
|
||||
<!--
|
||||
Please provide details about your environment.
|
||||
-->
|
||||
|
||||
**ESP (ESP32/ESP8266/Board/Sonoff):**
|
||||
<!--
|
||||
Please provide details about which ESP you're using.
|
||||
-->
|
||||
|
||||
**Affected component:**
|
||||
<!--
|
||||
Please add the link to the documentation at https://esphomelib.com/esphomeyaml/index.html of the component in question.
|
||||
-->
|
||||
|
||||
|
||||
**Description of problem:**
|
||||
|
||||
|
||||
**Problem-relevant YAML-configuration entries:**
|
||||
```yaml
|
||||
PASTE YAML FILE HERE
|
||||
```
|
||||
|
||||
**Traceback (if applicable):**
|
||||
<!--
|
||||
Please copy the traceback here if compilation is failing. If possible, also connect to the ESP and copy its logs into the backticks.
|
||||
-->
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
**Additional information:**
|
21
.github/ISSUE_TEMPLATE/feature_request.md
vendored
21
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,21 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
|
||||
<!-- READ THIS FIRST:
|
||||
- This is for feature requests only, if you want to have a certain new sensor/module supported, please use the "new integration" template.
|
||||
- Please be as descriptive as possible, especially use-cases that can otherwise not be solved boost the problem's priority.
|
||||
|
||||
DO NOT DELETE ANY TEXT from this template! Otherwise the issue may be closed without a comment.
|
||||
-->
|
||||
|
||||
**Is your feature request related to a problem/use-case? Please describe.**
|
||||
<!-- A clear and concise description of what the problem is. -->
|
||||
|
||||
**Describe the solution you'd like:**
|
||||
<!-- A description of what you want to happen. -->
|
||||
|
||||
**Additional context:**
|
||||
<!-- Add any other context about the feature request here. -->
|
13
.github/ISSUE_TEMPLATE/new-integration.md
vendored
13
.github/ISSUE_TEMPLATE/new-integration.md
vendored
@ -1,13 +0,0 @@
|
||||
---
|
||||
name: New integration
|
||||
about: Suggest a new integration for esphomelib
|
||||
|
||||
---
|
||||
|
||||
DO NOT POST NEW INTEGRATION REQUESTS HERE!
|
||||
|
||||
Please post all new integration requests in the esphomelib repository:
|
||||
|
||||
https://github.com/OttoWinter/esphomelib/issues
|
||||
|
||||
Thank you!
|
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -3,8 +3,8 @@
|
||||
|
||||
**Related issue (if applicable):** fixes <link to issue>
|
||||
|
||||
**Pull request in [esphomedocs](https://github.com/OttoWinter/esphomedocs) with documentation (if applicable):** OttoWinter/esphomedocs#<esphomedocs PR number goes here>
|
||||
**Pull request in [esphomelib](https://github.com/OttoWinter/esphomelib) with C++ framework changes (if applicable):** OttoWinter/esphomelib#<esphomelib PR number goes here>
|
||||
**Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable):** esphome/esphome-docs#<esphome-docs PR number goes here>
|
||||
**Pull request in [esphome-core](https://github.com/esphome/esphome-core) with C++ framework changes (if applicable):** esphome/esphome-core#<esphome-core PR number goes here>
|
||||
|
||||
## Checklist:
|
||||
- [ ] The code change is tested and works locally.
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -105,4 +105,4 @@ venv.bak/
|
||||
|
||||
config/
|
||||
tests/build/
|
||||
tests/.esphomeyaml/
|
||||
tests/.esphome/
|
||||
|
241
.gitlab-ci.yml
241
.gitlab-ci.yml
@ -15,7 +15,7 @@ stages:
|
||||
- pip install -e .
|
||||
tags:
|
||||
- python2.7
|
||||
- esphomeyaml-lint
|
||||
- esphome-lint
|
||||
|
||||
.test: &test
|
||||
stage: test
|
||||
@ -23,7 +23,7 @@ stages:
|
||||
- pip install -e .
|
||||
tags:
|
||||
- python2.7
|
||||
- esphomeyaml-test
|
||||
- esphome-test
|
||||
variables:
|
||||
TZ: UTC
|
||||
|
||||
@ -39,253 +39,34 @@ stages:
|
||||
flake8:
|
||||
<<: *lint
|
||||
script:
|
||||
- flake8 esphomeyaml
|
||||
- flake8 esphome
|
||||
|
||||
pylint:
|
||||
<<: *lint
|
||||
script:
|
||||
- pylint esphomeyaml
|
||||
- pylint esphome
|
||||
|
||||
test1:
|
||||
<<: *test
|
||||
script:
|
||||
- esphomeyaml tests/test1.yaml compile
|
||||
- esphome tests/test1.yaml compile
|
||||
|
||||
test2:
|
||||
<<: *test
|
||||
script:
|
||||
- esphomeyaml tests/test2.yaml compile
|
||||
- esphome tests/test2.yaml compile
|
||||
|
||||
.build-hassio: &build-hassio
|
||||
<<: *docker-builder
|
||||
stage: build
|
||||
test3:
|
||||
<<: *test
|
||||
script:
|
||||
- docker run --rm --privileged hassioaddons/qemu-user-static:latest
|
||||
- BUILD_FROM=hassioaddons/ubuntu-base-${ADDON_ARCH}:2.2.1
|
||||
- ADDON_VERSION="${CI_COMMIT_TAG#v}"
|
||||
- ADDON_VERSION="${ADDON_VERSION:-${CI_COMMIT_SHA:0:7}}"
|
||||
- echo "Build from ${BUILD_FROM}"
|
||||
- echo "Add-on version ${ADDON_VERSION}"
|
||||
- echo "Tag ${CI_REGISTRY}/esphomeyaml-hassio-${ADDON_ARCH}:dev"
|
||||
- echo "Tag ${CI_REGISTRY}/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}"
|
||||
- |
|
||||
docker build \
|
||||
--build-arg "BUILD_FROM=${BUILD_FROM}" \
|
||||
--build-arg "BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ")" \
|
||||
--build-arg "BUILD_ARCH=${ADDON_ARCH}" \
|
||||
--build-arg "BUILD_REF=${CI_COMMIT_SHA}" \
|
||||
--build-arg "BUILD_VERSION=${ADDON_VERSION}" \
|
||||
--tag "${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:dev" \
|
||||
--tag "${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}" \
|
||||
--file "docker/Dockerfile.hassio" \
|
||||
.
|
||||
- |
|
||||
if [ "${DO_PUSH:-true}" = true ]; then
|
||||
echo "Pushing to CI registry"
|
||||
docker push ${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}
|
||||
docker push ${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:dev
|
||||
fi
|
||||
|
||||
# Generic deploy template
|
||||
.deploy-release: &deploy-release
|
||||
<<: *docker-builder
|
||||
stage: deploy
|
||||
script:
|
||||
- version="${CI_COMMIT_TAG#v}"
|
||||
- echo "Publishing release version ${version}"
|
||||
- docker pull "${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}"
|
||||
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
|
||||
|
||||
- echo "Tag ${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}"
|
||||
- |
|
||||
docker tag \
|
||||
"${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}" \
|
||||
"${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}"
|
||||
- docker push "${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}"
|
||||
|
||||
- echo "Tag ${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:latest"
|
||||
- |
|
||||
docker tag \
|
||||
"${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}" \
|
||||
"${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:latest"
|
||||
- docker push "${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:latest"
|
||||
|
||||
- echo "Tag ${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:rc"
|
||||
- |
|
||||
docker tag \
|
||||
"${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}" \
|
||||
"${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:rc"
|
||||
- docker push "${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:rc"
|
||||
|
||||
- echo "Tag ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}"
|
||||
- |
|
||||
docker tag \
|
||||
"${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}" \
|
||||
"ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}"
|
||||
- docker push "ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}"
|
||||
|
||||
- echo "Tag ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:latest"
|
||||
- |
|
||||
docker tag \
|
||||
"ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}" \
|
||||
"ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:latest"
|
||||
- docker push "ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:latest"
|
||||
|
||||
- echo "Tag ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:rc"
|
||||
- |
|
||||
docker tag \
|
||||
"ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}" \
|
||||
"ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:rc"
|
||||
- docker push "ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:rc"
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+$/
|
||||
except:
|
||||
- /^(?!master).+@/
|
||||
|
||||
.deploy-beta: &deploy-beta
|
||||
<<: *docker-builder
|
||||
stage: deploy
|
||||
script:
|
||||
- version="${CI_COMMIT_TAG#v}"
|
||||
- echo "Publishing beta version ${version}"
|
||||
- docker pull "${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}"
|
||||
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
|
||||
|
||||
- echo "Tag ${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}"
|
||||
- |
|
||||
docker tag \
|
||||
"${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}" \
|
||||
"${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}"
|
||||
- docker push "${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}"
|
||||
|
||||
- echo "Tag ${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:rc"
|
||||
- |
|
||||
docker tag \
|
||||
"${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}" \
|
||||
"${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:rc"
|
||||
- docker push "${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:rc"
|
||||
|
||||
- echo "Tag ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}"
|
||||
- |
|
||||
docker tag \
|
||||
"${CI_REGISTRY}/ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}" \
|
||||
"ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}"
|
||||
- docker push "ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}"
|
||||
|
||||
- echo "Tag ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:rc"
|
||||
- |
|
||||
docker tag \
|
||||
"ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:${version}" \
|
||||
"ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:rc"
|
||||
- docker push "ottowinter/esphomeyaml-hassio-${ADDON_ARCH}:rc"
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+b\d+$/
|
||||
except:
|
||||
- /^(?!rc).+@/
|
||||
- esphome tests/test3.yaml compile
|
||||
|
||||
# Build jobs
|
||||
build:normal:
|
||||
<<: *docker-builder
|
||||
stage: build
|
||||
script:
|
||||
- docker build -t "${CI_REGISTRY}/ottowinter/esphomeyaml:dev" .
|
||||
|
||||
.build-hassio-edge: &build-hassio-edge
|
||||
<<: *build-hassio
|
||||
except:
|
||||
- /^v\d+\.\d+\.\d+$/
|
||||
- /^v\d+\.\d+\.\d+b\d+$/
|
||||
|
||||
.build-hassio-release: &build-hassio-release
|
||||
<<: *build-hassio
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+$/
|
||||
- /^v\d+\.\d+\.\d+b\d+$/
|
||||
|
||||
build:hassio-armhf-edge:
|
||||
<<: *build-hassio-edge
|
||||
variables:
|
||||
ADDON_ARCH: armhf
|
||||
DO_PUSH: "false"
|
||||
|
||||
build:hassio-armhf:
|
||||
<<: *build-hassio-release
|
||||
variables:
|
||||
ADDON_ARCH: armhf
|
||||
|
||||
#build:hassio-aarch64-edge:
|
||||
# <<: *build-hassio-edge
|
||||
# variables:
|
||||
# ADDON_ARCH: aarch64
|
||||
# DO_PUSH: "false"
|
||||
|
||||
#build:hassio-aarch64:
|
||||
# <<: *build-hassio-release
|
||||
# variables:
|
||||
# ADDON_ARCH: aarch64
|
||||
|
||||
build:hassio-i386-edge:
|
||||
<<: *build-hassio-edge
|
||||
variables:
|
||||
ADDON_ARCH: i386
|
||||
DO_PUSH: "false"
|
||||
|
||||
build:hassio-i386:
|
||||
<<: *build-hassio-release
|
||||
variables:
|
||||
ADDON_ARCH: i386
|
||||
|
||||
build:hassio-amd64-edge:
|
||||
<<: *build-hassio-edge
|
||||
variables:
|
||||
ADDON_ARCH: amd64
|
||||
DO_PUSH: "false"
|
||||
|
||||
build:hassio-amd64:
|
||||
<<: *build-hassio-release
|
||||
variables:
|
||||
ADDON_ARCH: amd64
|
||||
|
||||
# Deploy jobs
|
||||
deploy-release:armhf:
|
||||
<<: *deploy-release
|
||||
variables:
|
||||
ADDON_ARCH: armhf
|
||||
|
||||
deploy-beta:armhf:
|
||||
<<: *deploy-beta
|
||||
variables:
|
||||
ADDON_ARCH: armhf
|
||||
|
||||
#deploy-release:aarch64:
|
||||
# <<: *deploy-release
|
||||
# variables:
|
||||
# ADDON_ARCH: aarch64
|
||||
|
||||
#deploy-beta:aarch64:
|
||||
# <<: *deploy-beta
|
||||
# variables:
|
||||
# ADDON_ARCH: aarch64
|
||||
|
||||
deploy-release:i386:
|
||||
<<: *deploy-release
|
||||
variables:
|
||||
ADDON_ARCH: i386
|
||||
|
||||
deploy-beta:i386:
|
||||
<<: *deploy-beta
|
||||
variables:
|
||||
ADDON_ARCH: i386
|
||||
|
||||
deploy-release:amd64:
|
||||
<<: *deploy-release
|
||||
variables:
|
||||
ADDON_ARCH: amd64
|
||||
|
||||
deploy-beta:amd64:
|
||||
<<: *deploy-beta
|
||||
variables:
|
||||
ADDON_ARCH: amd64
|
||||
- docker build -t "${CI_REGISTRY}/esphome/esphome:dev" .
|
||||
|
||||
.deploy-pypi: &deploy-pypi
|
||||
stage: deploy
|
||||
@ -297,7 +78,7 @@ deploy-beta:amd64:
|
||||
- twine upload dist/*
|
||||
tags:
|
||||
- python2.7
|
||||
- esphomeyaml-test
|
||||
- esphome-test
|
||||
|
||||
deploy-release:pypi:
|
||||
<<: *deploy-pypi
|
||||
|
18
.travis.yml
18
.travis.yml
@ -8,24 +8,24 @@ matrix:
|
||||
env: TARGET=Lint2.7
|
||||
install: pip install -e . && pip install flake8==3.6.0 pylint==1.9.4 pillow
|
||||
script:
|
||||
- flake8 esphomeyaml
|
||||
- pylint esphomeyaml
|
||||
- flake8 esphome
|
||||
- pylint esphome
|
||||
- python: "3.5.3"
|
||||
env: TARGET=Lint3.5
|
||||
install: pip install -U https://github.com/platformio/platformio-core/archive/develop.zip && pip install -e . && pip install flake8==3.6.0 pylint==2.2.2 pillow
|
||||
script:
|
||||
- flake8 esphomeyaml
|
||||
- pylint esphomeyaml
|
||||
- flake8 esphome
|
||||
- pylint esphome
|
||||
- python: "2.7"
|
||||
env: TARGET=Test2.7
|
||||
install: pip install -e . && pip install flake8==3.6.0 pylint==1.9.4 pillow
|
||||
script:
|
||||
- esphomeyaml tests/test1.yaml compile
|
||||
- esphomeyaml tests/test2.yaml compile
|
||||
- esphomeyaml tests/test3.yaml compile
|
||||
- esphome tests/test1.yaml compile
|
||||
- esphome tests/test2.yaml compile
|
||||
- esphome tests/test3.yaml compile
|
||||
#- python: "3.5.3"
|
||||
# env: TARGET=Test3.5
|
||||
# install: pip install -U https://github.com/platformio/platformio-core/archive/develop.zip && pip install -e . && pip install flake8==3.6.0 pylint==2.2.2 pillow
|
||||
# script:
|
||||
# - esphomeyaml tests/test1.yaml compile
|
||||
# - esphomeyaml tests/test2.yaml compile
|
||||
# - esphome tests/test1.yaml compile
|
||||
# - esphome tests/test2.yaml compile
|
||||
|
@ -1,16 +1,16 @@
|
||||
# Contributing to esphomeyaml
|
||||
# Contributing to ESPHome
|
||||
|
||||
esphomeyaml is a part of esphomelib and is responsible for reading in YAML configuration files,
|
||||
This python project is responsible for reading in YAML configuration files,
|
||||
converting them to C++ code. This code is then converted to a platformio project and compiled
|
||||
with [esphomelib](https://github.com/OttoWinter/esphomelib), the C++ framework behind the project.
|
||||
with [esphome-core](https://github.com/esphome/esphome-core), the C++ framework behind the project.
|
||||
|
||||
For a detailed guide, please see https://esphomelib.com/esphomeyaml/guides/contributing.html#contributing-to-esphomeyaml
|
||||
For a detailed guide, please see https://esphome.io/guides/contributing.html#contributing-to-esphomeyaml
|
||||
|
||||
Things to note when contributing:
|
||||
|
||||
- Please test your changes :)
|
||||
- If a new feature is added or an existing user-facing feature is changed, you should also
|
||||
update the [docs](https://github.com/OttoWinter/esphomedocs). See [contributing to esphomedocs](https://esphomelib.com/esphomeyaml/guides/contributing.html#contributing-to-esphomedocs)
|
||||
update the [docs](https://github.com/esphome/esphome-docs). See [contributing to esphome-docs](https://esphome.io/guides/contributing.html#contributing-to-esphomedocs)
|
||||
for more information.
|
||||
- Please also update the tests in the `tests/` folder. You can do so by just adding a line in one of the YAML files
|
||||
which checks if your new feature compiles correctly.
|
||||
|
28
Dockerfile
28
Dockerfile
@ -1,28 +0,0 @@
|
||||
ARG BUILD_FROM=python:2.7
|
||||
FROM ${BUILD_FROM}
|
||||
MAINTAINER Otto Winter <contact@otto-winter.com>
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
git \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* && \
|
||||
pip install --no-cache-dir --no-binary :all: platformio && \
|
||||
platformio settings set enable_telemetry No && \
|
||||
platformio settings set check_libraries_interval 1000000 && \
|
||||
platformio settings set check_platformio_interval 1000000 && \
|
||||
platformio settings set check_platforms_interval 1000000
|
||||
|
||||
ENV ESPHOMEYAML_OTA_HOST_PORT=6123
|
||||
EXPOSE 6123
|
||||
VOLUME /config
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY docker/platformio.ini /pio/platformio.ini
|
||||
RUN platformio run -d /pio; rm -rf /pio
|
||||
|
||||
COPY . .
|
||||
RUN pip install --no-cache-dir --no-binary :all: -e . && \
|
||||
pip install --no-cache-dir pillow
|
||||
|
||||
WORKDIR /config
|
||||
ENTRYPOINT ["esphomeyaml"]
|
||||
CMD ["/config", "dashboard"]
|
32
MANIFEST.in
32
MANIFEST.in
@ -1,17 +1,17 @@
|
||||
include README.md
|
||||
include esphomeyaml/dashboard/templates/index.html
|
||||
include esphomeyaml/dashboard/templates/login.html
|
||||
include esphomeyaml/dashboard/static/ace.js
|
||||
include esphomeyaml/dashboard/static/esphomeyaml.css
|
||||
include esphomeyaml/dashboard/static/esphomeyaml.js
|
||||
include esphomeyaml/dashboard/static/favicon.ico
|
||||
include esphomeyaml/dashboard/static/jquery.min.js
|
||||
include esphomeyaml/dashboard/static/jquery.validate.min.js
|
||||
include esphomeyaml/dashboard/static/jquery-ui.min.js
|
||||
include esphomeyaml/dashboard/static/materialize.min.css
|
||||
include esphomeyaml/dashboard/static/materialize.min.js
|
||||
include esphomeyaml/dashboard/static/materialize-stepper.min.css
|
||||
include esphomeyaml/dashboard/static/materialize-stepper.min.js
|
||||
include esphomeyaml/dashboard/static/mode-yaml.js
|
||||
include esphomeyaml/dashboard/static/theme-dreamweaver.js
|
||||
include esphomeyaml/dashboard/static/ext-searchbox.js
|
||||
include esphome/dashboard/templates/index.html
|
||||
include esphome/dashboard/templates/login.html
|
||||
include esphome/dashboard/static/ace.js
|
||||
include esphome/dashboard/static/esphome.css
|
||||
include esphome/dashboard/static/esphome.js
|
||||
include esphome/dashboard/static/favicon.ico
|
||||
include esphome/dashboard/static/jquery.min.js
|
||||
include esphome/dashboard/static/jquery.validate.min.js
|
||||
include esphome/dashboard/static/jquery-ui.min.js
|
||||
include esphome/dashboard/static/materialize.min.css
|
||||
include esphome/dashboard/static/materialize.min.js
|
||||
include esphome/dashboard/static/materialize-stepper.min.css
|
||||
include esphome/dashboard/static/materialize-stepper.min.js
|
||||
include esphome/dashboard/static/mode-yaml.js
|
||||
include esphome/dashboard/static/theme-dreamweaver.js
|
||||
include esphome/dashboard/static/ext-searchbox.js
|
||||
|
39
README.md
39
README.md
@ -1,38 +1,3 @@
|
||||
# esphomeyaml for [esphomelib](https://github.com/OttoWinter/esphomelib)
|
||||
# ESPHome
|
||||
|
||||
### Getting Started Guide: https://esphomelib.com/esphomeyaml/guides/getting_started_command_line.html
|
||||
|
||||
### Available Components: https://esphomelib.com/esphomeyaml/index.html
|
||||
|
||||
esphomeyaml is the solution for your ESP8266/ESP32 projects with Home Assistant. It allows you to create **custom firmwares** for your microcontrollers with no programming experience required. All you need to know is the YAML configuration format which is also used by [Home Assistant](https://www.home-assistant.io).
|
||||
|
||||
esphomeyaml will:
|
||||
|
||||
* Read your configuration file and warn you about potential errors (like using the invalid pins.)
|
||||
* Create a custom C++ sketch file for you using esphomeyaml's powerful C++ generation engine.
|
||||
* Compile the sketch file for you using [platformio](http://platformio.org/).
|
||||
* Upload the binary to your ESP via Over the Air updates.
|
||||
* Automatically start remote logs via MQTT.
|
||||
|
||||
And all of that with a single command 🎉:
|
||||
|
||||
```bash
|
||||
esphomeyaml configuration.yaml run
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
* **No programming experience required:** just edit YAML configuration
|
||||
files like you're used to with Home Assistant.
|
||||
* **Flexible:** Use [esphomelib](https://github.com/OttoWinter/esphomelib)'s powerful core to create custom sensors/outputs.
|
||||
* **Fast and efficient:** Written in C++ and keeps memory consumption to a minimum.
|
||||
* **Made for [Home Assistant](https://www.home-assistant.io):** Almost all [Home Assistant](https://www.home-assistant.io) features are supported out of the box. Including RGB lights and many more.
|
||||
* **Easy reproducible configuration:** No need to go through a long setup process for every single node. Just copy a configuration file and run a single command.
|
||||
* **Smart Over The Air Updates:** esphomeyaml has OTA updates deeply integrated into the system. It even automatically enters a recovery mode if a boot loop is detected.
|
||||
* **Powerful logging engine:** View colorful logs and debug issues remotely.
|
||||
* **Open Source**
|
||||
* For me: Makes documenting esphomelib's features a lot easier.
|
||||
|
||||
## Special Thanks
|
||||
|
||||
Special Thanks to the Home Assistant project. Lots of the code base of esphomeyaml is based off of Home Assistant, for example the loading and config validation code.
|
||||
# TODO
|
11
docker/Dockerfile
Normal file
11
docker/Dockerfile
Normal file
@ -0,0 +1,11 @@
|
||||
ARG BUILD_FROM=esphome/esphome-base-amd64:1.0.0
|
||||
FROM ${BUILD_FROM}
|
||||
|
||||
COPY . .
|
||||
RUN \
|
||||
pip install --no-cache-dir --no-binary :all: -e . && \
|
||||
pip install --no-cache-dir pillow
|
||||
|
||||
WORKDIR /config
|
||||
ENTRYPOINT ["esphome"]
|
||||
CMD ["/config", "dashboard"]
|
@ -1,30 +0,0 @@
|
||||
FROM multiarch/ubuntu-core:amd64-xenial
|
||||
|
||||
# setup locals
|
||||
RUN apt-get update && apt-get install -y \
|
||||
jq \
|
||||
git \
|
||||
python3-setuptools \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
ENV LANG C.UTF-8
|
||||
|
||||
# Install docker
|
||||
# https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
|
||||
RUN apt-get update && apt-get install -y \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
software-properties-common \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
|
||||
&& add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
|
||||
&& apt-get update && apt-get install -y docker-ce \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# setup arm binary support
|
||||
RUN apt-get update && apt-get install -y \
|
||||
qemu-user-static \
|
||||
binfmt-support \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /data
|
@ -1,73 +1,29 @@
|
||||
ARG BUILD_FROM=hassioaddons/ubuntu-base:2.2.1
|
||||
# hadolint ignore=DL3006
|
||||
ARG BUILD_FROM=esphome/esphome-hassio-base-amd64:1.0.0
|
||||
FROM ${BUILD_FROM}
|
||||
|
||||
# Set shell
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# Copy root filesystem
|
||||
COPY esphomeyaml-edge/rootfs /
|
||||
COPY setup.py setup.cfg MANIFEST.in /opt/esphomeyaml/
|
||||
COPY esphomeyaml /opt/esphomeyaml/esphomeyaml
|
||||
|
||||
RUN \
|
||||
# Temporarily move nginx.conf (otherwise dpkg fails)
|
||||
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bkp \
|
||||
# Install add-on dependencies
|
||||
&& apt-get update \
|
||||
apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
# Python for esphomeyaml
|
||||
python \
|
||||
python-pip \
|
||||
python-setuptools \
|
||||
# Python Pillow for display component
|
||||
python-pil \
|
||||
# Git for esphomelib downloads
|
||||
git \
|
||||
# NGINX proxy
|
||||
nginx \
|
||||
\
|
||||
&& mv /etc/nginx/nginx.conf.bkp /etc/nginx/nginx.conf \
|
||||
\
|
||||
&& pip2 install --no-cache-dir --no-binary :all: -e /opt/esphomeyaml \
|
||||
\
|
||||
# Change some platformio settings
|
||||
&& platformio settings set enable_telemetry No \
|
||||
&& platformio settings set check_libraries_interval 1000000 \
|
||||
&& platformio settings set check_platformio_interval 1000000 \
|
||||
&& platformio settings set check_platforms_interval 1000000 \
|
||||
\
|
||||
# Build an empty platformio project to force platformio to install all fw build dependencies
|
||||
# The return-code will be non-zero since there's nothing to build.
|
||||
&& (platformio run -d /opt/pio; echo "Done") \
|
||||
\
|
||||
# Cleanup
|
||||
&& rm -fr \
|
||||
&& rm -rf \
|
||||
/tmp/* \
|
||||
/var/{cache,log}/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/opt/pio/
|
||||
/var/lib/apt/lists/*
|
||||
|
||||
# Build arugments
|
||||
ARG BUILD_ARCH=amd64
|
||||
ARG BUILD_DATE
|
||||
ARG BUILD_REF
|
||||
ARG BUILD_VERSION
|
||||
# Copy root filesystem
|
||||
COPY docker/rootfs/ /
|
||||
COPY setup.py setup.cfg MANIFEST.in /opt/esphome/
|
||||
COPY esphome /opt/esphome/esphome
|
||||
|
||||
RUN \
|
||||
pip2 install --no-cache-dir --no-binary :all: -e /opt/esphome
|
||||
|
||||
# Build arguments
|
||||
ARG BUILD_VERSION=dev
|
||||
|
||||
# Labels
|
||||
LABEL \
|
||||
io.hass.name="esphomeyaml" \
|
||||
io.hass.name="ESPHome" \
|
||||
io.hass.description="Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files" \
|
||||
io.hass.arch="${BUILD_ARCH}" \
|
||||
io.hass.type="addon" \
|
||||
io.hass.version=${BUILD_VERSION} \
|
||||
maintainer="Otto Winter <contact@otto-winter.com>" \
|
||||
org.label-schema.description="Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files" \
|
||||
org.label-schema.build-date=${BUILD_DATE} \
|
||||
org.label-schema.name="esphomeyaml" \
|
||||
org.label-schema.schema-version="1.0" \
|
||||
org.label-schema.url="https://esphomelib.com" \
|
||||
org.label-schema.usage="https://github.com/OttoWinter/esphomeyaml/tree/dev/esphomeyaml/README.md" \
|
||||
org.label-schema.vcs-ref=${BUILD_REF} \
|
||||
org.label-schema.vcs-url="https://github.com/OttoWinter/esphomeyaml" \
|
||||
org.label-schema.vendor="esphomelib"
|
||||
io.hass.version=${BUILD_VERSION}
|
||||
|
25
docker/hooks/build
Executable file
25
docker/hooks/build
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# the Docker repository tag being built.
|
||||
declare CACHE_TAG
|
||||
echo "CACHE_TAG: ${CACHE_TAG}"
|
||||
# the name and tag of the Docker repository being built. (This variable is a combination of DOCKER_REPO:CACHE_TAG.)
|
||||
declare IMAGE_NAME
|
||||
echo "IMAGE_NAME: ${IMAGE_NAME}"
|
||||
# the architecture to build
|
||||
declare BUILD_ARCH
|
||||
echo "BUILD_ARCH: ${BUILD_ARCH}"
|
||||
# whether this is a hassio build
|
||||
declare IS_HASSIO
|
||||
echo "IS_HASSIO: ${IS_HASSIO}"
|
||||
|
||||
if [[ ${IS_HASSIO} = "YES" ]]; then
|
||||
docker build \
|
||||
--build-arg "BUILD_FROM=esphome/esphome-hassio-base-${BUILD_ARCH}:1.0.0" \
|
||||
--build-arg "BUILD_VERSION=${CACHE_TAG}" \
|
||||
-t "${IMAGE_NAME}" -f docker/Dockerfile.hassio .
|
||||
else
|
||||
docker build \
|
||||
--build-arg "BUILD_FROM=esphome/esphome-base-${BUILD_ARCH}:1.0.0" \
|
||||
-t "${IMAGE_NAME}" -f docker/Dockerfile .
|
||||
fi
|
18
docker/hooks/pre_build
Executable file
18
docker/hooks/pre_build
Executable file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# the architecture to build
|
||||
declare BUILD_ARCH
|
||||
|
||||
echo "BUILD_ARCH: ${BUILD_ARCH}"
|
||||
|
||||
if [[ ${BUILD_ARCH} = "amd64" ]]; then
|
||||
echo "No qemu required..."
|
||||
exit 0
|
||||
fi
|
||||
if [[ ${BUILD_ARCH} = "i386" ]]; then
|
||||
echo "No qemu required..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Installing qemu..."
|
||||
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
35
docker/rootfs/etc/cont-init.d/10-requirements.sh
Executable file
35
docker/rootfs/etc/cont-init.d/10-requirements.sh
Executable file
@ -0,0 +1,35 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: ESPHome
|
||||
# This files check if all user configuration requirements are met
|
||||
# ==============================================================================
|
||||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
# Check SSL requirements, if enabled
|
||||
if hass.config.true 'ssl'; then
|
||||
if ! hass.config.has_value 'certfile'; then
|
||||
hass.die 'SSL is enabled, but no certfile was specified.'
|
||||
fi
|
||||
|
||||
if ! hass.config.has_value 'keyfile'; then
|
||||
hass.die 'SSL is enabled, but no keyfile was specified'
|
||||
fi
|
||||
|
||||
if ! hass.file_exists "/ssl/$(hass.config.get 'certfile')"; then
|
||||
if ! hass.file_exists "/ssl/$(hass.config.get 'keyfile')"; then
|
||||
# Both files are missing, let's print a friendlier error message
|
||||
text="You enabled encrypted connections using the \"ssl\": true option.
|
||||
However, the SSL files \"$(hass.config.get 'certfile')\" and \"$(hass.config.get 'keyfile')\"
|
||||
were not found. If you're using Hass.io on your local network and don't want
|
||||
to encrypt connections to the ESPHome dashboard, you can manually disable
|
||||
SSL by setting \"ssl\" to false."
|
||||
hass.die "${text}"
|
||||
fi
|
||||
hass.die 'The configured certfile is not found'
|
||||
fi
|
||||
|
||||
if ! hass.file_exists "/ssl/$(hass.config.get 'keyfile')"; then
|
||||
hass.die 'The configured keyfile is not found'
|
||||
fi
|
||||
fi
|
28
docker/rootfs/etc/cont-init.d/20-nginx.sh
Executable file
28
docker/rootfs/etc/cont-init.d/20-nginx.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: ESPHome
|
||||
# Configures NGINX for use with ESPHome
|
||||
# ==============================================================================
|
||||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
declare certfile
|
||||
declare keyfile
|
||||
declare port
|
||||
|
||||
mkdir -p /var/log/nginx
|
||||
|
||||
# Enable SSL
|
||||
if hass.config.true 'ssl'; then
|
||||
rm /etc/nginx/nginx.conf
|
||||
mv /etc/nginx/nginx-ssl.conf /etc/nginx/nginx.conf
|
||||
|
||||
certfile=$(hass.config.get 'certfile')
|
||||
keyfile=$(hass.config.get 'keyfile')
|
||||
|
||||
sed -i "s/%%certfile%%/${certfile}/g" /etc/nginx/nginx.conf
|
||||
sed -i "s/%%keyfile%%/${keyfile}/g" /etc/nginx/nginx.conf
|
||||
fi
|
||||
|
||||
port=$(hass.config.get 'port')
|
||||
sed -i "s/%%port%%/${port}/g" /etc/nginx/nginx.conf
|
@ -1,14 +1,14 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: esphomeyaml
|
||||
# This files installs the user esphomeyaml version if specified
|
||||
# Community Hass.io Add-ons: ESPHome
|
||||
# This files installs the user ESPHome version if specified
|
||||
# ==============================================================================
|
||||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
declare esphomeyaml_version
|
||||
declare esphome_version
|
||||
|
||||
if hass.config.has_value 'esphomeyaml_version'; then
|
||||
esphomeyaml_version=$(hass.config.get 'esphomeyaml_version')
|
||||
pip2 install --no-cache-dir --no-binary :all: "https://github.com/OttoWinter/esphomeyaml/archive/${esphomeyaml_version}.zip"
|
||||
if hass.config.has_value 'esphome_version'; then
|
||||
esphome_version=$(hass.config.get 'esphome_version')
|
||||
pip2 install --no-cache-dir --no-binary :all: "https://github.com/esphome/esphome/archive/${esphome_version}.zip"
|
||||
fi
|
13
docker/rootfs/etc/cont-init.d/40-migrate.sh
Normal file
13
docker/rootfs/etc/cont-init.d/40-migrate.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: ESPHome
|
||||
# This files migrates the esphome config directory from the old path
|
||||
# ==============================================================================
|
||||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
if [[ ! -d /config/esphome && -d /config/esphomeyaml ]]; then
|
||||
echo "Moving config directory from /config/esphomeyaml to /config/esphome"
|
||||
mv /config/esphomeyaml /config/esphome
|
||||
mv /config/esphome/.esphomeyaml /config/esphome/.esphome
|
||||
fi
|
62
docker/rootfs/etc/nginx/nginx-ssl.conf
Executable file
62
docker/rootfs/etc/nginx/nginx-ssl.conf
Executable file
@ -0,0 +1,62 @@
|
||||
worker_processes 1;
|
||||
pid /var/run/nginx.pid;
|
||||
error_log stderr;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
access_log stdout;
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
upstream esphome {
|
||||
ip_hash;
|
||||
server unix:/var/run/esphome.sock;
|
||||
}
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
server {
|
||||
server_name hassio.local;
|
||||
listen %%port%% default_server ssl;
|
||||
root /dev/null;
|
||||
|
||||
ssl_certificate /ssl/%%certfile%%;
|
||||
ssl_certificate_key /ssl/%%keyfile%%;
|
||||
ssl_protocols TLSv1.2;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA;
|
||||
ssl_ecdh_curve secp384r1;
|
||||
ssl_session_timeout 10m;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_tickets off;
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
|
||||
# Redirect http requests to https on the same port.
|
||||
# https://rageagainstshell.com/2016/11/redirect-http-to-https-on-the-same-port-in-nginx/
|
||||
error_page 497 https://$http_host$request_uri;
|
||||
|
||||
location / {
|
||||
proxy_redirect off;
|
||||
proxy_pass http://esphome;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Authorization "";
|
||||
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-NginX-Proxy true;
|
||||
}
|
||||
}
|
||||
}
|
46
docker/rootfs/etc/nginx/nginx.conf
Executable file
46
docker/rootfs/etc/nginx/nginx.conf
Executable file
@ -0,0 +1,46 @@
|
||||
worker_processes 1;
|
||||
pid /var/run/nginx.pid;
|
||||
error_log stderr;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
access_log stdout;
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
upstream esphome {
|
||||
ip_hash;
|
||||
server unix:/var/run/esphome.sock;
|
||||
}
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
server {
|
||||
server_name hassio.local;
|
||||
listen %%port%% default_server;
|
||||
root /dev/null;
|
||||
|
||||
location / {
|
||||
proxy_redirect off;
|
||||
proxy_pass http://esphome;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Authorization "";
|
||||
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-NginX-Proxy true;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/execlineb -S0
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: esphomeyaml
|
||||
# Take down the S6 supervision tree when esphomeyaml fails
|
||||
# Community Hass.io Add-ons: ESPHome
|
||||
# Take down the S6 supervision tree when ESPHome fails
|
||||
# ==============================================================================
|
||||
if -n { s6-test $# -ne 0 }
|
||||
if -n { s6-test ${1} -eq 256 }
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: esphomeyaml
|
||||
# Runs the esphomeyaml dashboard
|
||||
# Community Hass.io Add-ons: ESPHome
|
||||
# Runs the ESPHome dashboard
|
||||
# ==============================================================================
|
||||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
@ -10,5 +10,5 @@ if hass.config.true 'leave_front_door_open'; then
|
||||
export DISABLE_HA_AUTHENTICATION=true
|
||||
fi
|
||||
|
||||
hass.log.info "Starting esphomeyaml dashboard..."
|
||||
exec esphomeyaml /config/esphomeyaml dashboard --socket /var/run/esphomeyaml.sock --hassio
|
||||
hass.log.info "Starting ESPHome dashboard..."
|
||||
exec esphome /config/esphome dashboard --socket /var/run/esphome.sock --hassio
|
9
docker/rootfs/etc/services.d/nginx/finish
Executable file
9
docker/rootfs/etc/services.d/nginx/finish
Executable file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/execlineb -S0
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: ESPHome
|
||||
# Take down the S6 supervision tree when NGINX fails
|
||||
# ==============================================================================
|
||||
if -n { s6-test $# -ne 0 }
|
||||
if -n { s6-test ${1} -eq 256 }
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
10
docker/rootfs/etc/services.d/nginx/run
Executable file
10
docker/rootfs/etc/services.d/nginx/run
Executable file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: ESPHome
|
||||
# Runs the NGINX proxy
|
||||
# ==============================================================================
|
||||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
hass.log.info "Starting NGINX..."
|
||||
exec nginx -g "daemon off;"
|
@ -8,22 +8,22 @@ import os
|
||||
import random
|
||||
import sys
|
||||
|
||||
from esphomeyaml import const, core_config, mqtt, platformio_api, wizard, writer, yaml_util
|
||||
from esphomeyaml.api.client import run_logs
|
||||
from esphomeyaml.config import get_component, iter_components, read_config, strip_default_ids
|
||||
from esphomeyaml.const import CONF_BAUD_RATE, CONF_ESPHOMEYAML, CONF_LOGGER, CONF_USE_CUSTOM_CODE, \
|
||||
CONF_BROKER
|
||||
from esphomeyaml.core import CORE, EsphomeyamlError
|
||||
from esphomeyaml.cpp_generator import Expression, RawStatement, add, statement
|
||||
from esphomeyaml.helpers import color, indent
|
||||
from esphomeyaml.py_compat import safe_input, text_type, IS_PY2
|
||||
from esphomeyaml.storage_json import StorageJSON, esphomeyaml_storage_path, \
|
||||
from esphome import const, core_config, mqtt, platformio_api, wizard, writer, yaml_util
|
||||
from esphome.api.client import run_logs
|
||||
from esphome.config import get_component, iter_components, read_config, strip_default_ids
|
||||
from esphome.const import CONF_BAUD_RATE, CONF_BROKER, CONF_ESPHOME, CONF_LOGGER, \
|
||||
CONF_USE_CUSTOM_CODE
|
||||
from esphome.core import CORE, EsphomeError
|
||||
from esphome.cpp_generator import Expression, RawStatement, add, statement
|
||||
from esphome.helpers import color, indent
|
||||
from esphome.py_compat import IS_PY2, safe_input, text_type
|
||||
from esphome.storage_json import StorageJSON, esphome_storage_path, \
|
||||
start_update_check_thread, storage_path
|
||||
from esphomeyaml.util import run_external_command, run_external_process, safe_print
|
||||
from esphome.util import run_external_command, run_external_process, safe_print
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
PRE_INITIALIZE = ['esphomeyaml', 'logger', 'wifi', 'ethernet', 'ota', 'mqtt', 'web_server', 'api',
|
||||
PRE_INITIALIZE = ['esphome', 'logger', 'wifi', 'ethernet', 'ota', 'mqtt', 'web_server', 'api',
|
||||
'i2c']
|
||||
|
||||
|
||||
@ -127,9 +127,9 @@ def run_miniterm(config, port):
|
||||
def write_cpp(config):
|
||||
_LOGGER.info("Generating C++ source...")
|
||||
|
||||
CORE.add_job(core_config.to_code, config[CONF_ESPHOMEYAML], domain='esphomeyaml')
|
||||
CORE.add_job(core_config.to_code, config[CONF_ESPHOME], domain='esphome')
|
||||
for domain in PRE_INITIALIZE:
|
||||
if domain == CONF_ESPHOMEYAML or domain not in config:
|
||||
if domain == CONF_ESPHOME or domain not in config:
|
||||
continue
|
||||
CORE.add_job(get_component(domain).to_code, config[domain], domain=domain)
|
||||
|
||||
@ -143,7 +143,7 @@ def write_cpp(config):
|
||||
add(RawStatement(''))
|
||||
all_code = []
|
||||
for exp in CORE.expressions:
|
||||
if not config[CONF_ESPHOMEYAML][CONF_USE_CUSTOM_CODE]:
|
||||
if not config[CONF_ESPHOME][CONF_USE_CUSTOM_CODE]:
|
||||
if isinstance(exp, Expression) and not exp.required:
|
||||
continue
|
||||
all_code.append(text_type(statement(exp)))
|
||||
@ -157,9 +157,9 @@ def write_cpp(config):
|
||||
|
||||
def compile_program(args, config):
|
||||
_LOGGER.info("Compiling app...")
|
||||
update_check = not os.getenv('ESPHOMEYAML_NO_UPDATE_CHECK', '')
|
||||
update_check = not os.getenv('ESPHOME_NO_UPDATE_CHECK', '')
|
||||
if update_check:
|
||||
thread = start_update_check_thread(esphomeyaml_storage_path(CORE.config_dir))
|
||||
thread = start_update_check_thread(esphome_storage_path(CORE.config_dir))
|
||||
rc = platformio_api.run_compile(config, args.verbose)
|
||||
if update_check:
|
||||
thread.join()
|
||||
@ -186,13 +186,13 @@ def upload_program(config, args, host):
|
||||
return upload_using_esptool(config, host)
|
||||
return platformio_api.run_upload(config, args.verbose, host)
|
||||
|
||||
from esphomeyaml.components import ota
|
||||
from esphomeyaml import espota2
|
||||
from esphome.components import ota
|
||||
from esphome import espota2
|
||||
|
||||
if args.host_port is not None:
|
||||
host_port = args.host_port
|
||||
else:
|
||||
host_port = int(os.getenv('ESPHOMEYAML_OTA_HOST_PORT', random.randint(10000, 60000)))
|
||||
host_port = int(os.getenv('ESPHOME_OTA_HOST_PORT', random.randint(10000, 60000)))
|
||||
|
||||
verbose = args.verbose
|
||||
remote_port = ota.get_port(config)
|
||||
@ -215,7 +215,7 @@ def upload_program(config, args, host):
|
||||
|
||||
def show_logs(config, args, port):
|
||||
if 'logger' not in config:
|
||||
raise EsphomeyamlError("Logger is not configured!")
|
||||
raise EsphomeError("Logger is not configured!")
|
||||
if get_port_type(port) == 'SERIAL':
|
||||
run_miniterm(config, port)
|
||||
return 0
|
||||
@ -345,7 +345,7 @@ def command_clean(args, config):
|
||||
|
||||
|
||||
def command_hass_config(args, config):
|
||||
from esphomeyaml.components import mqtt as mqtt_component
|
||||
from esphome.components import mqtt as mqtt_component
|
||||
|
||||
_LOGGER.info("This is what you should put in your Home Assistant YAML configuration.")
|
||||
_LOGGER.info("Please note this is only necessary if you're not using MQTT discovery.")
|
||||
@ -367,7 +367,7 @@ def command_hass_config(args, config):
|
||||
|
||||
|
||||
def command_dashboard(args):
|
||||
from esphomeyaml.dashboard import dashboard
|
||||
from esphome.dashboard import dashboard
|
||||
|
||||
return dashboard.start_web_server(args)
|
||||
|
||||
@ -392,8 +392,8 @@ POST_CONFIG_ACTIONS = {
|
||||
|
||||
|
||||
def parse_args(argv):
|
||||
parser = argparse.ArgumentParser(prog='esphomeyaml')
|
||||
parser.add_argument('-v', '--verbose', help="Enable verbose esphomeyaml logs.",
|
||||
parser = argparse.ArgumentParser(prog='esphome')
|
||||
parser.add_argument('-v', '--verbose', help="Enable verbose esphome logs.",
|
||||
action='store_true')
|
||||
parser.add_argument('--dashboard', help="Internal flag to set if the command is run from the "
|
||||
"dashboard.", action='store_true')
|
||||
@ -444,11 +444,11 @@ def parse_args(argv):
|
||||
parser_clean.add_argument('--client-id', help='Manually set the client id.')
|
||||
|
||||
subparsers.add_parser('wizard', help="A helpful setup wizard that will guide "
|
||||
"you through setting up esphomeyaml.")
|
||||
"you through setting up esphome.")
|
||||
|
||||
subparsers.add_parser('mqtt-fingerprint', help="Get the SSL fingerprint from a MQTT broker.")
|
||||
|
||||
subparsers.add_parser('version', help="Print the esphomeyaml version and exit.")
|
||||
subparsers.add_parser('version', help="Print the esphome version and exit.")
|
||||
|
||||
subparsers.add_parser('clean', help="Delete all temporary build files.")
|
||||
|
||||
@ -461,7 +461,7 @@ def parse_args(argv):
|
||||
dashboard.add_argument("--open-ui", help="Open the dashboard UI in a browser.",
|
||||
action='store_true')
|
||||
dashboard.add_argument("--hassio",
|
||||
help="Internal flag used to tell esphomeyaml is started as a Hass.io "
|
||||
help="Internal flag used to tell esphome is started as a Hass.io "
|
||||
"add-on.",
|
||||
action="store_true")
|
||||
dashboard.add_argument("--socket",
|
||||
@ -474,7 +474,7 @@ def parse_args(argv):
|
||||
return parser.parse_args(argv[1:])
|
||||
|
||||
|
||||
def run_esphomeyaml(argv):
|
||||
def run_esphome(argv):
|
||||
args = parse_args(argv)
|
||||
CORE.dashboard = args.dashboard
|
||||
|
||||
@ -482,7 +482,7 @@ def run_esphomeyaml(argv):
|
||||
if args.command in PRE_CONFIG_ACTIONS:
|
||||
try:
|
||||
return PRE_CONFIG_ACTIONS[args.command](args)
|
||||
except EsphomeyamlError as e:
|
||||
except EsphomeError as e:
|
||||
_LOGGER.error(e)
|
||||
return 1
|
||||
|
||||
@ -496,7 +496,7 @@ def run_esphomeyaml(argv):
|
||||
if args.command in POST_CONFIG_ACTIONS:
|
||||
try:
|
||||
return POST_CONFIG_ACTIONS[args.command](args, config)
|
||||
except EsphomeyamlError as e:
|
||||
except EsphomeError as e:
|
||||
_LOGGER.error(e)
|
||||
return 1
|
||||
safe_print(u"Unknown command {}".format(args.command))
|
||||
@ -505,8 +505,8 @@ def run_esphomeyaml(argv):
|
||||
|
||||
def main():
|
||||
try:
|
||||
return run_esphomeyaml(sys.argv)
|
||||
except EsphomeyamlError as e:
|
||||
return run_esphome(sys.argv)
|
||||
except EsphomeError as e:
|
||||
_LOGGER.error(e)
|
||||
return 1
|
||||
except KeyboardInterrupt:
|
@ -92,7 +92,7 @@ message DeviceInfoResponse {
|
||||
|
||||
// A string describing the date of compilation, this is generated by the compiler
|
||||
// and therefore may not be in the same format all the time.
|
||||
// If the user isn't using esphomeyaml, this will also not be set.
|
||||
// If the user isn't using esphome, this will also not be set.
|
||||
string compilation_time = 5;
|
||||
|
||||
// The model of the board. For example NodeMCU
|
@ -9,18 +9,18 @@ import time
|
||||
from typing import Optional # noqa
|
||||
from google.protobuf import message # noqa
|
||||
|
||||
from esphomeyaml import const
|
||||
import esphomeyaml.api.api_pb2 as pb
|
||||
from esphomeyaml.const import CONF_PASSWORD, CONF_PORT
|
||||
from esphomeyaml.core import EsphomeyamlError
|
||||
from esphomeyaml.helpers import resolve_ip_address, indent, color
|
||||
from esphomeyaml.py_compat import text_type, IS_PY2, byte_to_bytes, char_to_byte, format_bytes
|
||||
from esphomeyaml.util import safe_print
|
||||
from esphome import const
|
||||
import esphome.api.api_pb2 as pb
|
||||
from esphome.const import CONF_PASSWORD, CONF_PORT
|
||||
from esphome.core import EsphomeError
|
||||
from esphome.helpers import resolve_ip_address, indent, color
|
||||
from esphome.py_compat import text_type, IS_PY2, byte_to_bytes, char_to_byte, format_bytes
|
||||
from esphome.util import safe_print
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class APIConnectionError(EsphomeyamlError):
|
||||
class APIConnectionError(EsphomeError):
|
||||
pass
|
||||
|
||||
|
||||
@ -179,11 +179,11 @@ class APIClient(threading.Thread):
|
||||
|
||||
try:
|
||||
ip = resolve_ip_address(self._address)
|
||||
except EsphomeyamlError as err:
|
||||
except EsphomeError as err:
|
||||
_LOGGER.warning("Error resolving IP address of %s. Is it connected to WiFi?",
|
||||
self._address)
|
||||
_LOGGER.warning("(If this error persists, please set a static IP address: "
|
||||
"https://esphomelib.com/esphomeyaml/components/wifi.html#manual-ips)")
|
||||
"https://esphome.io/components/wifi.html#manual-ips)")
|
||||
raise APIConnectionError(err)
|
||||
|
||||
_LOGGER.info("Connecting to %s:%s (%s)", self._address, self._port, ip)
|
||||
@ -200,7 +200,7 @@ class APIClient(threading.Thread):
|
||||
self._socket_open_event.set()
|
||||
|
||||
hello = pb.HelloRequest()
|
||||
hello.client_info = 'esphomeyaml v{}'.format(const.__version__)
|
||||
hello.client_info = 'ESPHome v{}'.format(const.__version__)
|
||||
try:
|
||||
resp = self._send_message_await_response(hello, pb.HelloResponse)
|
||||
except APIConnectionError as err:
|
||||
@ -423,7 +423,7 @@ def run_logs(config, address):
|
||||
conf = config['api']
|
||||
port = conf[CONF_PORT]
|
||||
password = conf[CONF_PASSWORD]
|
||||
_LOGGER.info("Starting log output from %s using esphomelib API", address)
|
||||
_LOGGER.info("Starting log output from %s using esphome API", address)
|
||||
|
||||
cli = APIClient(address, port, password)
|
||||
stopping = False
|
@ -2,16 +2,16 @@ import copy
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ABOVE, CONF_ACTION_ID, CONF_AND, CONF_AUTOMATION_ID, \
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ABOVE, CONF_ACTION_ID, CONF_AND, CONF_AUTOMATION_ID, \
|
||||
CONF_BELOW, CONF_CONDITION, CONF_CONDITION_ID, CONF_DELAY, CONF_ELSE, CONF_ID, CONF_IF, \
|
||||
CONF_LAMBDA, CONF_OR, CONF_RANGE, CONF_THEN, CONF_TRIGGER_ID, CONF_WHILE
|
||||
from esphomeyaml.core import CORE
|
||||
from esphomeyaml.cpp_generator import Pvariable, TemplateArguments, add, get_variable, \
|
||||
from esphome.core import CORE
|
||||
from esphome.cpp_generator import Pvariable, TemplateArguments, add, get_variable, \
|
||||
process_lambda, templatable
|
||||
from esphomeyaml.cpp_types import Action, App, Component, PollingComponent, Trigger, bool_, \
|
||||
esphomelib_ns, float_, uint32, void
|
||||
from esphomeyaml.util import ServiceRegistry
|
||||
from esphome.cpp_types import Action, App, Component, PollingComponent, Trigger, bool_, \
|
||||
esphome_ns, float_, uint32, void
|
||||
from esphome.util import ServiceRegistry
|
||||
|
||||
|
||||
def maybe_simple_id(*validators):
|
||||
@ -98,18 +98,18 @@ ACTION_REGISTRY = ServiceRegistry()
|
||||
CONDITION_REGISTRY = ServiceRegistry()
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
DelayAction = esphomelib_ns.class_('DelayAction', Action, Component)
|
||||
LambdaAction = esphomelib_ns.class_('LambdaAction', Action)
|
||||
IfAction = esphomelib_ns.class_('IfAction', Action)
|
||||
WhileAction = esphomelib_ns.class_('WhileAction', Action)
|
||||
UpdateComponentAction = esphomelib_ns.class_('UpdateComponentAction', Action)
|
||||
Automation = esphomelib_ns.class_('Automation')
|
||||
DelayAction = esphome_ns.class_('DelayAction', Action, Component)
|
||||
LambdaAction = esphome_ns.class_('LambdaAction', Action)
|
||||
IfAction = esphome_ns.class_('IfAction', Action)
|
||||
WhileAction = esphome_ns.class_('WhileAction', Action)
|
||||
UpdateComponentAction = esphome_ns.class_('UpdateComponentAction', Action)
|
||||
Automation = esphome_ns.class_('Automation')
|
||||
|
||||
Condition = esphomelib_ns.class_('Condition')
|
||||
AndCondition = esphomelib_ns.class_('AndCondition', Condition)
|
||||
OrCondition = esphomelib_ns.class_('OrCondition', Condition)
|
||||
RangeCondition = esphomelib_ns.class_('RangeCondition', Condition)
|
||||
LambdaCondition = esphomelib_ns.class_('LambdaCondition', Condition)
|
||||
Condition = esphome_ns.class_('Condition')
|
||||
AndCondition = esphome_ns.class_('AndCondition', Condition)
|
||||
OrCondition = esphome_ns.class_('OrCondition', Condition)
|
||||
RangeCondition = esphome_ns.class_('RangeCondition', Condition)
|
||||
LambdaCondition = esphome_ns.class_('LambdaCondition', Condition)
|
||||
|
||||
|
||||
def validate_automation(extra_schema=None, extra_validators=None, single=False):
|
@ -1,11 +1,11 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import i2c, sensor
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ADDRESS, CONF_ID
|
||||
from esphomeyaml.cpp_generator import Pvariable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, Component
|
||||
from esphome.components import i2c, sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ADDRESS, CONF_ID
|
||||
from esphome.cpp_generator import Pvariable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, Component
|
||||
|
||||
DEPENDENCIES = ['i2c']
|
||||
MULTI_CONF = True
|
@ -1,11 +1,11 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import i2c, sensor
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ADDRESS, CONF_ID, CONF_UPDATE_INTERVAL
|
||||
from esphomeyaml.cpp_generator import Pvariable, add
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, PollingComponent
|
||||
from esphome.components import i2c, sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ADDRESS, CONF_ID, CONF_UPDATE_INTERVAL
|
||||
from esphome.cpp_generator import Pvariable, add
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, PollingComponent
|
||||
|
||||
DEPENDENCIES = ['i2c']
|
||||
MULTI_CONF = True
|
@ -1,15 +1,15 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.automation import ACTION_REGISTRY
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_DATA, CONF_DATA_TEMPLATE, CONF_ID, CONF_PASSWORD, CONF_PORT, \
|
||||
CONF_SERVICE, CONF_VARIABLES, CONF_REBOOT_TIMEOUT
|
||||
from esphomeyaml.core import CORE
|
||||
from esphomeyaml.cpp_generator import Pvariable, add, get_variable, process_lambda
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import Action, App, Component, StoringController, esphomelib_ns
|
||||
from esphome.automation import ACTION_REGISTRY
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_DATA, CONF_DATA_TEMPLATE, CONF_ID, CONF_PASSWORD, CONF_PORT, \
|
||||
CONF_REBOOT_TIMEOUT, CONF_SERVICE, CONF_VARIABLES
|
||||
from esphome.core import CORE
|
||||
from esphome.cpp_generator import Pvariable, add, get_variable, process_lambda
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import Action, App, Component, StoringController, esphome_ns
|
||||
|
||||
api_ns = esphomelib_ns.namespace('api')
|
||||
api_ns = esphome_ns.namespace('api')
|
||||
APIServer = api_ns.class_('APIServer', Component, StoringController)
|
||||
HomeAssistantServiceCallAction = api_ns.class_('HomeAssistantServiceCallAction', Action)
|
||||
KeyValuePair = api_ns.class_('KeyValuePair')
|
@ -1,21 +1,19 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import automation, core
|
||||
from esphomeyaml.automation import CONDITION_REGISTRY, Condition, maybe_simple_id
|
||||
from esphomeyaml.components import mqtt
|
||||
from esphomeyaml.components.mqtt import setup_mqtt_component
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_DELAYED_OFF, CONF_DELAYED_ON, CONF_DEVICE_CLASS, CONF_FILTERS, \
|
||||
from esphome import automation, core
|
||||
from esphome.automation import CONDITION_REGISTRY, Condition, maybe_simple_id
|
||||
from esphome.components import mqtt
|
||||
from esphome.components.mqtt import setup_mqtt_component
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_DELAYED_OFF, CONF_DELAYED_ON, CONF_DEVICE_CLASS, CONF_FILTERS, \
|
||||
CONF_HEARTBEAT, CONF_ID, CONF_INTERNAL, CONF_INVALID_COOLDOWN, CONF_INVERT, CONF_INVERTED, \
|
||||
CONF_LAMBDA, CONF_MAX_LENGTH, CONF_MIN_LENGTH, CONF_MQTT_ID, CONF_ON_CLICK, \
|
||||
CONF_ON_DOUBLE_CLICK, CONF_ON_MULTI_CLICK, CONF_ON_PRESS, CONF_ON_RELEASE, CONF_ON_STATE, \
|
||||
CONF_STATE, CONF_TIMING, CONF_TRIGGER_ID
|
||||
from esphomeyaml.core import CORE
|
||||
from esphomeyaml.cpp_generator import Pvariable, StructInitializer, add, get_variable, \
|
||||
process_lambda
|
||||
from esphomeyaml.cpp_types import App, Component, Nameable, NoArg, Trigger, bool_, esphomelib_ns, \
|
||||
optional
|
||||
from esphomeyaml.py_compat import string_types
|
||||
from esphome.core import CORE
|
||||
from esphome.cpp_generator import Pvariable, StructInitializer, add, get_variable, process_lambda
|
||||
from esphome.cpp_types import App, Component, Nameable, NoArg, Trigger, bool_, esphome_ns, optional
|
||||
from esphome.py_compat import string_types
|
||||
|
||||
DEVICE_CLASSES = [
|
||||
'', 'battery', 'cold', 'connectivity', 'door', 'garage_door', 'gas',
|
||||
@ -28,7 +26,7 @@ PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA.extend({
|
||||
|
||||
})
|
||||
|
||||
binary_sensor_ns = esphomelib_ns.namespace('binary_sensor')
|
||||
binary_sensor_ns = esphome_ns.namespace('binary_sensor')
|
||||
BinarySensor = binary_sensor_ns.class_('BinarySensor', Nameable)
|
||||
BinarySensorPtr = BinarySensor.operator('ptr')
|
||||
MQTTBinarySensorComponent = binary_sensor_ns.class_('MQTTBinarySensorComponent', mqtt.MQTTComponent)
|
||||
@ -191,7 +189,7 @@ BINARY_SENSOR_SCHEMA = cv.MQTT_COMPONENT_SCHEMA.extend({
|
||||
vol.Optional(CONF_INVERTED): cv.invalid(
|
||||
"The inverted binary_sensor property has been replaced by the "
|
||||
"new 'invert' binary sensor filter. Please see "
|
||||
"https://esphomelib.com/esphomeyaml/components/binary_sensor/index.html."
|
||||
"https://esphome.io/components/binary_sensor/index.html."
|
||||
),
|
||||
})
|
||||
|
@ -1,10 +1,10 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import binary_sensor, sensor
|
||||
from esphomeyaml.components.apds9960 import APDS9960, CONF_APDS9960_ID
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_DIRECTION, CONF_NAME
|
||||
from esphomeyaml.cpp_generator import get_variable
|
||||
from esphome.components import binary_sensor, sensor
|
||||
from esphome.components.apds9960 import APDS9960, CONF_APDS9960_ID
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_DIRECTION, CONF_NAME
|
||||
from esphome.cpp_generator import get_variable
|
||||
|
||||
DEPENDENCIES = ['apds9960']
|
||||
APDS9960GestureDirectionBinarySensor = sensor.sensor_ns.class_(
|
@ -1,10 +1,10 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import binary_sensor
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_BINARY_SENSORS, CONF_ID, CONF_LAMBDA, CONF_NAME
|
||||
from esphomeyaml.cpp_generator import process_lambda, variable, Pvariable, add
|
||||
from esphomeyaml.cpp_types import std_vector
|
||||
from esphome.components import binary_sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_BINARY_SENSORS, CONF_ID, CONF_LAMBDA, CONF_NAME
|
||||
from esphome.cpp_generator import Pvariable, add, process_lambda, variable
|
||||
from esphome.cpp_types import std_vector
|
||||
|
||||
CustomBinarySensorConstructor = binary_sensor.binary_sensor_ns.class_(
|
||||
'CustomBinarySensorConstructor')
|
@ -1,15 +1,15 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import binary_sensor
|
||||
from esphomeyaml.components.esp32_ble_tracker import CONF_ESP32_BLE_ID, ESP32BLETracker, \
|
||||
from esphome.components import binary_sensor
|
||||
from esphome.components.esp32_ble_tracker import CONF_ESP32_BLE_ID, ESP32BLETracker, \
|
||||
make_address_array
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_MAC_ADDRESS, CONF_NAME
|
||||
from esphomeyaml.cpp_generator import get_variable
|
||||
from esphomeyaml.cpp_types import esphomelib_ns
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_MAC_ADDRESS, CONF_NAME
|
||||
from esphome.cpp_generator import get_variable
|
||||
from esphome.cpp_types import esphome_ns
|
||||
|
||||
DEPENDENCIES = ['esp32_ble_tracker']
|
||||
ESP32BLEPresenceDevice = esphomelib_ns.class_('ESP32BLEPresenceDevice', binary_sensor.BinarySensor)
|
||||
ESP32BLEPresenceDevice = esphome_ns.class_('ESP32BLEPresenceDevice', binary_sensor.BinarySensor)
|
||||
|
||||
PLATFORM_SCHEMA = cv.nameable(binary_sensor.BINARY_SENSOR_PLATFORM_SCHEMA.extend({
|
||||
cv.GenerateID(): cv.declare_variable_id(ESP32BLEPresenceDevice),
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.components import binary_sensor
|
||||
from esphomeyaml.components.esp32_touch import ESP32TouchComponent
|
||||
from esphomeyaml.const import CONF_NAME, CONF_PIN, CONF_THRESHOLD, ESP_PLATFORM_ESP32
|
||||
from esphomeyaml.cpp_generator import get_variable
|
||||
from esphomeyaml.cpp_types import global_ns
|
||||
from esphomeyaml.pins import validate_gpio_pin
|
||||
from esphome.components import binary_sensor
|
||||
from esphome.components.esp32_touch import ESP32TouchComponent
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_NAME, CONF_PIN, CONF_THRESHOLD, ESP_PLATFORM_ESP32
|
||||
from esphome.cpp_generator import get_variable
|
||||
from esphome.cpp_types import global_ns
|
||||
from esphome.pins import validate_gpio_pin
|
||||
|
||||
ESP_PLATFORMS = [ESP_PLATFORM_ESP32]
|
||||
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import binary_sensor
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_NAME, CONF_PIN
|
||||
from esphomeyaml.cpp_generator import Pvariable
|
||||
from esphomeyaml.cpp_helpers import gpio_input_pin_expression, setup_component
|
||||
from esphomeyaml.cpp_types import App, Component
|
||||
from esphome import pins
|
||||
from esphome.components import binary_sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_NAME, CONF_PIN
|
||||
from esphome.cpp_generator import Pvariable
|
||||
from esphome.cpp_helpers import gpio_input_pin_expression, setup_component
|
||||
from esphome.cpp_types import App, Component
|
||||
|
||||
GPIOBinarySensorComponent = binary_sensor.binary_sensor_ns.class_('GPIOBinarySensorComponent',
|
||||
binary_sensor.BinarySensor,
|
@ -1,10 +1,10 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import binary_sensor
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ENTITY_ID, CONF_ID, CONF_NAME
|
||||
from esphomeyaml.cpp_generator import Pvariable
|
||||
from esphomeyaml.cpp_types import App
|
||||
from esphome.components import binary_sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ENTITY_ID, CONF_ID, CONF_NAME
|
||||
from esphome.cpp_generator import Pvariable
|
||||
from esphome.cpp_types import App
|
||||
|
||||
DEPENDENCIES = ['api']
|
||||
|
@ -1,10 +1,10 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import binary_sensor, display
|
||||
from esphomeyaml.components.display.nextion import Nextion
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_COMPONENT_ID, CONF_NAME, CONF_PAGE_ID
|
||||
from esphomeyaml.cpp_generator import get_variable
|
||||
from esphome.components import binary_sensor, display
|
||||
from esphome.components.display.nextion import Nextion
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_COMPONENT_ID, CONF_NAME, CONF_PAGE_ID
|
||||
from esphome.cpp_generator import get_variable
|
||||
|
||||
DEPENDENCIES = ['display']
|
||||
|
@ -1,11 +1,11 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import binary_sensor
|
||||
from esphomeyaml.components.pn532 import PN532Component
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_NAME, CONF_UID
|
||||
from esphomeyaml.core import HexInt
|
||||
from esphomeyaml.cpp_generator import get_variable
|
||||
from esphome.components import binary_sensor
|
||||
from esphome.components.pn532 import PN532Component
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_NAME, CONF_UID
|
||||
from esphome.core import HexInt
|
||||
from esphome.cpp_generator import get_variable
|
||||
|
||||
DEPENDENCIES = ['pn532']
|
||||
|
@ -1,9 +1,9 @@
|
||||
import voluptuous as vol
|
||||
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.components import binary_sensor, rdm6300
|
||||
from esphomeyaml.const import CONF_NAME, CONF_UID
|
||||
from esphomeyaml.cpp_generator import get_variable
|
||||
from esphome.components import binary_sensor, rdm6300
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_NAME, CONF_UID
|
||||
from esphome.cpp_generator import get_variable
|
||||
|
||||
DEPENDENCIES = ['rdm6300']
|
||||
|
@ -1,18 +1,18 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import binary_sensor
|
||||
from esphomeyaml.components.remote_receiver import RemoteReceiverComponent, remote_ns
|
||||
from esphomeyaml.components.remote_transmitter import RC_SWITCH_RAW_SCHEMA, \
|
||||
from esphome.components import binary_sensor
|
||||
from esphome.components.remote_receiver import RemoteReceiverComponent, remote_ns
|
||||
from esphome.components.remote_transmitter import RC_SWITCH_RAW_SCHEMA, \
|
||||
RC_SWITCH_TYPE_A_SCHEMA, RC_SWITCH_TYPE_B_SCHEMA, RC_SWITCH_TYPE_C_SCHEMA, \
|
||||
RC_SWITCH_TYPE_D_SCHEMA, binary_code, build_rc_switch_protocol
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ADDRESS, CONF_CHANNEL, CONF_CODE, CONF_COMMAND, CONF_DATA, \
|
||||
CONF_DEVICE, CONF_FAMILY, CONF_GROUP, CONF_JVC, CONF_LG, CONF_NAME, CONF_NBITS, CONF_NEC, \
|
||||
CONF_PANASONIC, CONF_PROTOCOL, CONF_RAW, CONF_RC_SWITCH_RAW, CONF_RC_SWITCH_TYPE_A, \
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ADDRESS, CONF_CHANNEL, CONF_CODE, CONF_COMMAND, CONF_DATA, \
|
||||
CONF_DEVICE, CONF_FAMILY, CONF_GROUP, CONF_ID, CONF_JVC, CONF_LG, CONF_NAME, CONF_NBITS, \
|
||||
CONF_NEC, CONF_PANASONIC, CONF_PROTOCOL, CONF_RAW, CONF_RC_SWITCH_RAW, CONF_RC_SWITCH_TYPE_A, \
|
||||
CONF_RC_SWITCH_TYPE_B, CONF_RC_SWITCH_TYPE_C, CONF_RC_SWITCH_TYPE_D, CONF_SAMSUNG, CONF_SONY, \
|
||||
CONF_STATE, CONF_ID
|
||||
from esphomeyaml.cpp_generator import Pvariable, get_variable, progmem_array
|
||||
from esphomeyaml.cpp_types import int32
|
||||
CONF_STATE
|
||||
from esphome.cpp_generator import Pvariable, get_variable, progmem_array
|
||||
from esphome.cpp_types import int32
|
||||
|
||||
DEPENDENCIES = ['remote_receiver']
|
||||
|
@ -1,9 +1,9 @@
|
||||
from esphomeyaml.components import binary_sensor
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_NAME
|
||||
from esphomeyaml.cpp_generator import Pvariable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, Component
|
||||
from esphome.components import binary_sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_NAME
|
||||
from esphome.cpp_generator import Pvariable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, Component
|
||||
|
||||
StatusBinarySensor = binary_sensor.binary_sensor_ns.class_('StatusBinarySensor',
|
||||
binary_sensor.BinarySensor,
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.automation import ACTION_REGISTRY
|
||||
from esphomeyaml.components import binary_sensor
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_LAMBDA, CONF_NAME, CONF_STATE
|
||||
from esphomeyaml.cpp_generator import Pvariable, add, get_variable, process_lambda, templatable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import Action, App, Component, bool_, optional
|
||||
from esphome.automation import ACTION_REGISTRY
|
||||
from esphome.components import binary_sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_LAMBDA, CONF_NAME, CONF_STATE
|
||||
from esphome.cpp_generator import Pvariable, add, get_variable, process_lambda, templatable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import Action, App, Component, bool_, optional
|
||||
|
||||
TemplateBinarySensor = binary_sensor.binary_sensor_ns.class_('TemplateBinarySensor',
|
||||
binary_sensor.BinarySensor,
|
@ -1,19 +1,19 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.automation import ACTION_REGISTRY, maybe_simple_id
|
||||
from esphomeyaml.components import mqtt
|
||||
from esphomeyaml.components.mqtt import setup_mqtt_component
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_INTERNAL, CONF_MQTT_ID
|
||||
from esphomeyaml.core import CORE
|
||||
from esphomeyaml.cpp_generator import Pvariable, add, get_variable
|
||||
from esphomeyaml.cpp_types import Action, Nameable, esphomelib_ns
|
||||
from esphome.automation import ACTION_REGISTRY, maybe_simple_id
|
||||
from esphome.components import mqtt
|
||||
from esphome.components.mqtt import setup_mqtt_component
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_INTERNAL, CONF_MQTT_ID
|
||||
from esphome.core import CORE
|
||||
from esphome.cpp_generator import Pvariable, add, get_variable
|
||||
from esphome.cpp_types import Action, Nameable, esphome_ns
|
||||
|
||||
PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA.extend({
|
||||
|
||||
})
|
||||
|
||||
cover_ns = esphomelib_ns.namespace('cover')
|
||||
cover_ns = esphome_ns.namespace('cover')
|
||||
|
||||
Cover = cover_ns.class_('Cover', Nameable)
|
||||
MQTTCoverComponent = cover_ns.class_('MQTTCoverComponent', mqtt.MQTTComponent)
|
@ -1,15 +1,15 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import automation
|
||||
from esphomeyaml.automation import ACTION_REGISTRY
|
||||
from esphomeyaml.components import cover
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ASSUMED_STATE, CONF_CLOSE_ACTION, CONF_ID, CONF_LAMBDA, \
|
||||
CONF_NAME, CONF_OPEN_ACTION, CONF_OPTIMISTIC, CONF_STATE, CONF_STOP_ACTION
|
||||
from esphomeyaml.cpp_generator import Pvariable, add, get_variable, process_lambda, templatable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import Action, App, NoArg, optional
|
||||
from esphomeyaml.py_compat import string_types
|
||||
from esphome import automation
|
||||
from esphome.automation import ACTION_REGISTRY
|
||||
from esphome.components import cover
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ASSUMED_STATE, CONF_CLOSE_ACTION, CONF_ID, CONF_LAMBDA, CONF_NAME, \
|
||||
CONF_OPEN_ACTION, CONF_OPTIMISTIC, CONF_STATE, CONF_STOP_ACTION
|
||||
from esphome.cpp_generator import Pvariable, add, get_variable, process_lambda, templatable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import Action, App, NoArg, optional
|
||||
from esphome.py_compat import string_types
|
||||
|
||||
TemplateCover = cover.cover_ns.class_('TemplateCover', cover.Cover)
|
||||
CoverPublishAction = cover.cover_ns.class_('CoverPublishAction', Action)
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_LAMBDA, CONF_COMPONENTS
|
||||
from esphomeyaml.cpp_generator import process_lambda, variable, Pvariable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import Component, ComponentPtr, esphomelib_ns, std_vector
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_COMPONENTS, CONF_ID, CONF_LAMBDA
|
||||
from esphome.cpp_generator import Pvariable, process_lambda, variable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import Component, ComponentPtr, esphome_ns, std_vector
|
||||
|
||||
CustomComponentConstructor = esphomelib_ns.class_('CustomComponentConstructor')
|
||||
CustomComponentConstructor = esphome_ns.class_('CustomComponentConstructor')
|
||||
MULTI_CONF = True
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema({
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import sensor
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_PIN, CONF_UPDATE_INTERVAL
|
||||
from esphomeyaml.cpp_generator import Pvariable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, PollingComponent
|
||||
from esphome import pins
|
||||
from esphome.components import sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_PIN, CONF_UPDATE_INTERVAL
|
||||
from esphome.cpp_generator import Pvariable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, PollingComponent
|
||||
|
||||
DallasComponent = sensor.sensor_ns.class_('DallasComponent', PollingComponent)
|
||||
MULTI_CONF = True
|
@ -1,7 +1,7 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.cpp_generator import add
|
||||
from esphomeyaml.cpp_types import App
|
||||
from esphome.cpp_generator import add
|
||||
from esphome.cpp_types import App
|
||||
|
||||
DEPENDENCIES = ['logger']
|
||||
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import config_validation as cv, pins
|
||||
from esphomeyaml.automation import ACTION_REGISTRY, maybe_simple_id
|
||||
from esphomeyaml.const import CONF_ID, CONF_MODE, CONF_NUMBER, CONF_PINS, CONF_RUN_CYCLES, \
|
||||
from esphome import config_validation as cv, pins
|
||||
from esphome.automation import ACTION_REGISTRY, maybe_simple_id
|
||||
from esphome.const import CONF_ID, CONF_MODE, CONF_NUMBER, CONF_PINS, CONF_RUN_CYCLES, \
|
||||
CONF_RUN_DURATION, CONF_SLEEP_DURATION, CONF_WAKEUP_PIN
|
||||
from esphomeyaml.cpp_generator import Pvariable, StructInitializer, add, get_variable
|
||||
from esphomeyaml.cpp_helpers import gpio_input_pin_expression, setup_component
|
||||
from esphomeyaml.cpp_types import Action, App, Component, esphomelib_ns, global_ns
|
||||
from esphome.cpp_generator import Pvariable, StructInitializer, add, get_variable
|
||||
from esphome.cpp_helpers import gpio_input_pin_expression, setup_component
|
||||
from esphome.cpp_types import Action, App, Component, esphome_ns, global_ns
|
||||
|
||||
|
||||
def validate_pin_number(value):
|
||||
@ -17,11 +17,11 @@ def validate_pin_number(value):
|
||||
return value
|
||||
|
||||
|
||||
DeepSleepComponent = esphomelib_ns.class_('DeepSleepComponent', Component)
|
||||
EnterDeepSleepAction = esphomelib_ns.class_('EnterDeepSleepAction', Action)
|
||||
PreventDeepSleepAction = esphomelib_ns.class_('PreventDeepSleepAction', Action)
|
||||
DeepSleepComponent = esphome_ns.class_('DeepSleepComponent', Component)
|
||||
EnterDeepSleepAction = esphome_ns.class_('EnterDeepSleepAction', Action)
|
||||
PreventDeepSleepAction = esphome_ns.class_('PreventDeepSleepAction', Action)
|
||||
|
||||
WakeupPinMode = esphomelib_ns.enum('WakeupPinMode')
|
||||
WakeupPinMode = esphome_ns.enum('WakeupPinMode')
|
||||
WAKEUP_PIN_MODES = {
|
||||
'IGNORE': WakeupPinMode.WAKEUP_PIN_MODE_IGNORE,
|
||||
'KEEP_AWAKE': WakeupPinMode.WAKEUP_PIN_MODE_KEEP_AWAKE,
|
||||
@ -29,7 +29,7 @@ WAKEUP_PIN_MODES = {
|
||||
}
|
||||
|
||||
esp_sleep_ext1_wakeup_mode_t = global_ns.enum('esp_sleep_ext1_wakeup_mode_t')
|
||||
Ext1Wakeup = esphomelib_ns.struct('Ext1Wakeup')
|
||||
Ext1Wakeup = esphome_ns.struct('Ext1Wakeup')
|
||||
EXT1_WAKEUP_MODES = {
|
||||
'ALL_LOW': esp_sleep_ext1_wakeup_mode_t.ESP_EXT1_WAKEUP_ALL_LOW,
|
||||
'ANY_HIGH': esp_sleep_ext1_wakeup_mode_t.ESP_EXT1_WAKEUP_ANY_HIGH,
|
@ -1,17 +1,17 @@
|
||||
# coding=utf-8
|
||||
import voluptuous as vol
|
||||
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_LAMBDA, CONF_ROTATION, CONF_UPDATE_INTERVAL
|
||||
from esphomeyaml.core import CORE
|
||||
from esphomeyaml.cpp_generator import add
|
||||
from esphomeyaml.cpp_types import esphomelib_ns
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_LAMBDA, CONF_ROTATION, CONF_UPDATE_INTERVAL
|
||||
from esphome.core import CORE
|
||||
from esphome.cpp_generator import add
|
||||
from esphome.cpp_types import esphome_ns
|
||||
|
||||
PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA.extend({
|
||||
|
||||
})
|
||||
|
||||
display_ns = esphomelib_ns.namespace('display')
|
||||
display_ns = esphome_ns.namespace('display')
|
||||
DisplayBuffer = display_ns.class_('DisplayBuffer')
|
||||
DisplayBufferRef = DisplayBuffer.operator('ref')
|
||||
|
@ -1,13 +1,13 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import display
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_DATA_PINS, CONF_DIMENSIONS, CONF_ENABLE_PIN, CONF_ID, \
|
||||
from esphome import pins
|
||||
from esphome.components import display
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_DATA_PINS, CONF_DIMENSIONS, CONF_ENABLE_PIN, CONF_ID, \
|
||||
CONF_LAMBDA, CONF_RS_PIN, CONF_RW_PIN
|
||||
from esphomeyaml.cpp_generator import Pvariable, add, process_lambda
|
||||
from esphomeyaml.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphomeyaml.cpp_types import App, PollingComponent, void
|
||||
from esphome.cpp_generator import Pvariable, add, process_lambda
|
||||
from esphome.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphome.cpp_types import App, PollingComponent, void
|
||||
|
||||
LCDDisplay = display.display_ns.class_('LCDDisplay', PollingComponent)
|
||||
LCDDisplayRef = LCDDisplay.operator('ref')
|
@ -1,13 +1,13 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import display, i2c
|
||||
from esphomeyaml.components.display.lcd_gpio import LCDDisplay, LCDDisplayRef, \
|
||||
from esphome.components import display, i2c
|
||||
from esphome.components.display.lcd_gpio import LCDDisplay, LCDDisplayRef, \
|
||||
validate_lcd_dimensions
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ADDRESS, CONF_DIMENSIONS, CONF_ID, CONF_LAMBDA
|
||||
from esphomeyaml.cpp_generator import Pvariable, add, process_lambda
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, void
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ADDRESS, CONF_DIMENSIONS, CONF_ID, CONF_LAMBDA
|
||||
from esphome.cpp_generator import Pvariable, add, process_lambda
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, void
|
||||
|
||||
DEPENDENCIES = ['i2c']
|
||||
|
@ -1,14 +1,14 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import display, spi
|
||||
from esphomeyaml.components.spi import SPIComponent
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_CS_PIN, CONF_ID, CONF_INTENSITY, CONF_LAMBDA, CONF_NUM_CHIPS, \
|
||||
from esphome import pins
|
||||
from esphome.components import display, spi
|
||||
from esphome.components.spi import SPIComponent
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_CS_PIN, CONF_ID, CONF_INTENSITY, CONF_LAMBDA, CONF_NUM_CHIPS, \
|
||||
CONF_SPI_ID
|
||||
from esphomeyaml.cpp_generator import Pvariable, add, get_variable, process_lambda
|
||||
from esphomeyaml.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphomeyaml.cpp_types import App, PollingComponent, void
|
||||
from esphome.cpp_generator import Pvariable, add, get_variable, process_lambda
|
||||
from esphome.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphome.cpp_types import App, PollingComponent, void
|
||||
|
||||
DEPENDENCIES = ['spi']
|
||||
|
@ -1,10 +1,10 @@
|
||||
from esphomeyaml.components import display, uart
|
||||
from esphomeyaml.components.uart import UARTComponent
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_LAMBDA, CONF_UART_ID
|
||||
from esphomeyaml.cpp_generator import Pvariable, add, get_variable, process_lambda
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, PollingComponent, void
|
||||
from esphome.components import display, uart
|
||||
from esphome.components.uart import UARTComponent
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_LAMBDA, CONF_UART_ID
|
||||
from esphome.cpp_generator import Pvariable, add, get_variable, process_lambda
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, PollingComponent, void
|
||||
|
||||
DEPENDENCIES = ['uart']
|
||||
|
@ -1,14 +1,14 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import display
|
||||
from esphomeyaml.components.display import ssd1306_spi
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ADDRESS, CONF_EXTERNAL_VCC, CONF_ID, CONF_LAMBDA, CONF_MODEL, \
|
||||
from esphome import pins
|
||||
from esphome.components import display
|
||||
from esphome.components.display import ssd1306_spi
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ADDRESS, CONF_EXTERNAL_VCC, CONF_ID, CONF_LAMBDA, CONF_MODEL, \
|
||||
CONF_RESET_PIN
|
||||
from esphomeyaml.cpp_generator import Pvariable, add, process_lambda
|
||||
from esphomeyaml.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphomeyaml.cpp_types import App, void
|
||||
from esphome.cpp_generator import Pvariable, add, process_lambda
|
||||
from esphome.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphome.cpp_types import App, void
|
||||
|
||||
DEPENDENCIES = ['i2c']
|
||||
|
@ -1,14 +1,14 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import display, spi
|
||||
from esphomeyaml.components.spi import SPIComponent
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_CS_PIN, CONF_DC_PIN, CONF_EXTERNAL_VCC, CONF_ID, CONF_LAMBDA, \
|
||||
from esphome import pins
|
||||
from esphome.components import display, spi
|
||||
from esphome.components.spi import SPIComponent
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_CS_PIN, CONF_DC_PIN, CONF_EXTERNAL_VCC, CONF_ID, CONF_LAMBDA, \
|
||||
CONF_MODEL, CONF_RESET_PIN, CONF_SPI_ID
|
||||
from esphomeyaml.cpp_generator import Pvariable, add, get_variable, process_lambda
|
||||
from esphomeyaml.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphomeyaml.cpp_types import App, PollingComponent, void
|
||||
from esphome.cpp_generator import Pvariable, add, get_variable, process_lambda
|
||||
from esphome.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphome.cpp_types import App, PollingComponent, void
|
||||
|
||||
DEPENDENCIES = ['spi']
|
||||
|
@ -1,15 +1,15 @@
|
||||
import voluptuous as vol
|
||||
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import display, spi
|
||||
from esphomeyaml.components.spi import SPIComponent
|
||||
from esphomeyaml.const import CONF_BUSY_PIN, CONF_CS_PIN, CONF_DC_PIN, CONF_FULL_UPDATE_EVERY, \
|
||||
from esphome import pins
|
||||
from esphome.components import display, spi
|
||||
from esphome.components.spi import SPIComponent
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_BUSY_PIN, CONF_CS_PIN, CONF_DC_PIN, CONF_FULL_UPDATE_EVERY, \
|
||||
CONF_ID, CONF_LAMBDA, CONF_MODEL, CONF_RESET_PIN, CONF_SPI_ID
|
||||
from esphomeyaml.cpp_generator import get_variable, Pvariable, process_lambda, add
|
||||
from esphomeyaml.cpp_helpers import gpio_output_pin_expression, gpio_input_pin_expression, \
|
||||
from esphome.cpp_generator import Pvariable, add, get_variable, process_lambda
|
||||
from esphome.cpp_helpers import gpio_input_pin_expression, gpio_output_pin_expression, \
|
||||
setup_component
|
||||
from esphomeyaml.cpp_types import PollingComponent, App, void
|
||||
from esphome.cpp_types import App, PollingComponent, void
|
||||
|
||||
DEPENDENCIES = ['spi']
|
||||
|
||||
@ -17,7 +17,6 @@ WaveshareEPaperTypeA = display.display_ns.WaveshareEPaperTypeA
|
||||
WaveshareEPaper = display.display_ns.class_('WaveshareEPaper',
|
||||
PollingComponent, spi.SPIDevice, display.DisplayBuffer)
|
||||
|
||||
|
||||
WaveshareEPaperTypeAModel = display.display_ns.enum('WaveshareEPaperTypeAModel')
|
||||
WaveshareEPaperTypeBModel = display.display_ns.enum('WaveshareEPaperTypeBModel')
|
||||
|
@ -1,14 +1,14 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_SCAN_INTERVAL, CONF_TYPE, CONF_UUID, ESP_PLATFORM_ESP32
|
||||
from esphomeyaml.cpp_generator import Pvariable, RawExpression, add
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, Component, esphomelib_ns
|
||||
from esphome import config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_SCAN_INTERVAL, CONF_TYPE, CONF_UUID, ESP_PLATFORM_ESP32
|
||||
from esphome.cpp_generator import Pvariable, RawExpression, add
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, Component, esphome_ns
|
||||
|
||||
ESP_PLATFORMS = [ESP_PLATFORM_ESP32]
|
||||
|
||||
ESP32BLEBeacon = esphomelib_ns.class_('ESP32BLEBeacon', Component)
|
||||
ESP32BLEBeacon = esphome_ns.class_('ESP32BLEBeacon', Component)
|
||||
|
||||
CONF_MAJOR = 'major'
|
||||
CONF_MINOR = 'minor'
|
@ -1,19 +1,19 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import config_validation as cv
|
||||
from esphomeyaml.components import sensor
|
||||
from esphomeyaml.const import CONF_ID, CONF_SCAN_INTERVAL, ESP_PLATFORM_ESP32
|
||||
from esphomeyaml.core import HexInt
|
||||
from esphomeyaml.cpp_generator import Pvariable, add
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, Component, esphomelib_ns
|
||||
from esphome import config_validation as cv
|
||||
from esphome.components import sensor
|
||||
from esphome.const import CONF_ID, CONF_SCAN_INTERVAL, ESP_PLATFORM_ESP32
|
||||
from esphome.core import HexInt
|
||||
from esphome.cpp_generator import Pvariable, add
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, Component, esphome_ns
|
||||
|
||||
ESP_PLATFORMS = [ESP_PLATFORM_ESP32]
|
||||
|
||||
CONF_ESP32_BLE_ID = 'esp32_ble_id'
|
||||
ESP32BLETracker = esphomelib_ns.class_('ESP32BLETracker', Component)
|
||||
XiaomiSensor = esphomelib_ns.class_('XiaomiSensor', sensor.Sensor)
|
||||
XiaomiDevice = esphomelib_ns.class_('XiaomiDevice')
|
||||
ESP32BLETracker = esphome_ns.class_('ESP32BLETracker', Component)
|
||||
XiaomiSensor = esphome_ns.class_('XiaomiSensor', sensor.Sensor)
|
||||
XiaomiDevice = esphome_ns.class_('XiaomiDevice')
|
||||
XIAOMI_SENSOR_SCHEMA = sensor.SENSOR_SCHEMA.extend({
|
||||
cv.GenerateID(): cv.declare_variable_id(XiaomiSensor)
|
||||
})
|
@ -1,14 +1,14 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import config_validation as cv
|
||||
from esphomeyaml.components import binary_sensor
|
||||
from esphomeyaml.const import CONF_HIGH_VOLTAGE_REFERENCE, CONF_ID, CONF_IIR_FILTER, \
|
||||
from esphome import config_validation as cv
|
||||
from esphome.components import binary_sensor
|
||||
from esphome.const import CONF_HIGH_VOLTAGE_REFERENCE, CONF_ID, CONF_IIR_FILTER, \
|
||||
CONF_LOW_VOLTAGE_REFERENCE, CONF_MEASUREMENT_DURATION, CONF_SETUP_MODE, CONF_SLEEP_DURATION, \
|
||||
CONF_VOLTAGE_ATTENUATION, ESP_PLATFORM_ESP32
|
||||
from esphomeyaml.core import TimePeriod
|
||||
from esphomeyaml.cpp_generator import Pvariable, add
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, Component, global_ns
|
||||
from esphome.core import TimePeriod
|
||||
from esphome.cpp_generator import Pvariable, add
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, Component, global_ns
|
||||
|
||||
ESP_PLATFORMS = [ESP_PLATFORM_ESP32]
|
||||
|
@ -1,14 +1,14 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import wifi
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_DOMAIN, CONF_ID, CONF_MANUAL_IP, CONF_TYPE, ESP_PLATFORM_ESP32, \
|
||||
CONF_USE_ADDRESS, CONF_STATIC_IP
|
||||
from esphomeyaml.core import CORE
|
||||
from esphomeyaml.cpp_generator import Pvariable, add
|
||||
from esphomeyaml.cpp_helpers import gpio_output_pin_expression
|
||||
from esphomeyaml.cpp_types import App, Component, esphomelib_ns, global_ns
|
||||
from esphome import pins
|
||||
from esphome.components import wifi
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_DOMAIN, CONF_ID, CONF_MANUAL_IP, CONF_STATIC_IP, CONF_TYPE, \
|
||||
CONF_USE_ADDRESS, ESP_PLATFORM_ESP32
|
||||
from esphome.core import CORE
|
||||
from esphome.cpp_generator import Pvariable, add
|
||||
from esphome.cpp_helpers import gpio_output_pin_expression
|
||||
from esphome.cpp_types import App, Component, esphome_ns, global_ns
|
||||
|
||||
CONFLICTS_WITH = ['wifi']
|
||||
ESP_PLATFORMS = [ESP_PLATFORM_ESP32]
|
||||
@ -19,7 +19,7 @@ CONF_MDIO_PIN = 'mdio_pin'
|
||||
CONF_CLK_MODE = 'clk_mode'
|
||||
CONF_POWER_PIN = 'power_pin'
|
||||
|
||||
EthernetType = esphomelib_ns.enum('EthernetType')
|
||||
EthernetType = esphome_ns.enum('EthernetType')
|
||||
ETHERNET_TYPES = {
|
||||
'LAN8720': EthernetType.ETHERNET_TYPE_LAN8720,
|
||||
'TLK110': EthernetType.ETHERNET_TYPE_TLK110,
|
||||
@ -33,7 +33,7 @@ CLK_MODES = {
|
||||
'GPIO17_OUT': eth_clock_mode_t.ETH_CLOCK_GPIO17_OUT,
|
||||
}
|
||||
|
||||
EthernetComponent = esphomelib_ns.class_('EthernetComponent', Component)
|
||||
EthernetComponent = esphome_ns.class_('EthernetComponent', Component)
|
||||
|
||||
|
||||
def validate(config):
|
@ -1,22 +1,22 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.automation import ACTION_REGISTRY, maybe_simple_id
|
||||
from esphomeyaml.components import mqtt
|
||||
from esphomeyaml.components.mqtt import setup_mqtt_component
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_INTERNAL, CONF_MQTT_ID, CONF_NAME, CONF_OSCILLATING, \
|
||||
from esphome.automation import ACTION_REGISTRY, maybe_simple_id
|
||||
from esphome.components import mqtt
|
||||
from esphome.components.mqtt import setup_mqtt_component
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_INTERNAL, CONF_MQTT_ID, CONF_NAME, CONF_OSCILLATING, \
|
||||
CONF_OSCILLATION_COMMAND_TOPIC, CONF_OSCILLATION_OUTPUT, CONF_OSCILLATION_STATE_TOPIC, \
|
||||
CONF_SPEED, CONF_SPEED_COMMAND_TOPIC, CONF_SPEED_STATE_TOPIC
|
||||
from esphomeyaml.core import CORE
|
||||
from esphomeyaml.cpp_generator import Pvariable, add, get_variable, templatable
|
||||
from esphomeyaml.cpp_types import Action, Application, Component, Nameable, bool_, esphomelib_ns
|
||||
from esphomeyaml.py_compat import string_types
|
||||
from esphome.core import CORE
|
||||
from esphome.cpp_generator import Pvariable, add, get_variable, templatable
|
||||
from esphome.cpp_types import Action, Application, Component, Nameable, bool_, esphome_ns
|
||||
from esphome.py_compat import string_types
|
||||
|
||||
PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA.extend({
|
||||
|
||||
})
|
||||
|
||||
fan_ns = esphomelib_ns.namespace('fan')
|
||||
fan_ns = esphome_ns.namespace('fan')
|
||||
FanState = fan_ns.class_('FanState', Nameable, Component)
|
||||
MQTTFanComponent = fan_ns.class_('MQTTFanComponent', mqtt.MQTTComponent)
|
||||
MakeFan = Application.struct('MakeFan')
|
@ -1,11 +1,11 @@
|
||||
import voluptuous as vol
|
||||
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.components import fan, output
|
||||
from esphomeyaml.const import CONF_MAKE_ID, CONF_NAME, CONF_OSCILLATION_OUTPUT, CONF_OUTPUT
|
||||
from esphomeyaml.cpp_generator import get_variable, variable, add
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App
|
||||
from esphome.components import fan, output
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_MAKE_ID, CONF_NAME, CONF_OSCILLATION_OUTPUT, CONF_OUTPUT
|
||||
from esphome.cpp_generator import add, get_variable, variable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App
|
||||
|
||||
PLATFORM_SCHEMA = cv.nameable(fan.FAN_PLATFORM_SCHEMA.extend({
|
||||
cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(fan.MakeFan),
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.components import fan, mqtt, output
|
||||
from esphomeyaml.const import CONF_HIGH, CONF_LOW, CONF_MAKE_ID, CONF_MEDIUM, CONF_NAME, \
|
||||
from esphome.components import fan, mqtt, output
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_HIGH, CONF_LOW, CONF_MAKE_ID, CONF_MEDIUM, CONF_NAME, \
|
||||
CONF_OSCILLATION_OUTPUT, CONF_OUTPUT, CONF_SPEED, CONF_SPEED_COMMAND_TOPIC, \
|
||||
CONF_SPEED_STATE_TOPIC
|
||||
from esphomeyaml.cpp_generator import get_variable, variable, add
|
||||
from esphomeyaml.cpp_types import App
|
||||
from esphome.cpp_generator import add, get_variable, variable
|
||||
from esphome.cpp_types import App
|
||||
|
||||
PLATFORM_SCHEMA = cv.nameable(fan.FAN_PLATFORM_SCHEMA.extend({
|
||||
cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(fan.MakeFan),
|
@ -1,14 +1,14 @@
|
||||
# coding=utf-8
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import core
|
||||
from esphomeyaml.components import display
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_FILE, CONF_GLYPHS, CONF_ID, CONF_SIZE
|
||||
from esphomeyaml.core import CORE, HexInt
|
||||
from esphomeyaml.cpp_generator import Pvariable, progmem_array, safe_exp
|
||||
from esphomeyaml.cpp_types import App, uint8
|
||||
from esphomeyaml.py_compat import sort_by_cmp
|
||||
from esphome import core
|
||||
from esphome.components import display
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_FILE, CONF_GLYPHS, CONF_ID, CONF_SIZE
|
||||
from esphome.core import CORE, HexInt
|
||||
from esphome.cpp_generator import Pvariable, progmem_array, safe_exp
|
||||
from esphome.cpp_types import App, uint8
|
||||
from esphome.py_compat import sort_by_cmp
|
||||
|
||||
DEPENDENCIES = ['display']
|
||||
MULTI_CONF = True
|
||||
@ -87,7 +87,7 @@ def to_code(config):
|
||||
try:
|
||||
font = ImageFont.truetype(path, config[CONF_SIZE])
|
||||
except Exception as e:
|
||||
raise core.EsphomeyamlError(u"Could not load truetype file {}: {}".format(path, e))
|
||||
raise core.EsphomeError(u"Could not load truetype file {}: {}".format(path, e))
|
||||
|
||||
ascent, descent = font.getmetrics()
|
||||
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_INITIAL_VALUE, CONF_RESTORE_VALUE, CONF_TYPE
|
||||
from esphomeyaml.cpp_generator import Pvariable, RawExpression, TemplateArguments, add
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, Component, esphomelib_ns
|
||||
from esphome import config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_INITIAL_VALUE, CONF_RESTORE_VALUE, CONF_TYPE
|
||||
from esphome.cpp_generator import Pvariable, RawExpression, TemplateArguments, add
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, Component, esphome_ns
|
||||
|
||||
GlobalVariableComponent = esphomelib_ns.class_('GlobalVariableComponent', Component)
|
||||
GlobalVariableComponent = esphome_ns.class_('GlobalVariableComponent', Component)
|
||||
|
||||
MULTI_CONF = True
|
||||
|
@ -1,14 +1,14 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_FREQUENCY, CONF_ID, CONF_RECEIVE_TIMEOUT, CONF_SCAN, CONF_SCL, \
|
||||
from esphome import pins
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_FREQUENCY, CONF_ID, CONF_RECEIVE_TIMEOUT, CONF_SCAN, CONF_SCL, \
|
||||
CONF_SDA
|
||||
from esphomeyaml.cpp_generator import Pvariable, add
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, Component, esphomelib_ns
|
||||
from esphome.cpp_generator import Pvariable, add
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, Component, esphome_ns
|
||||
|
||||
I2CComponent = esphomelib_ns.class_('I2CComponent', Component)
|
||||
I2CComponent = esphome_ns.class_('I2CComponent', Component)
|
||||
I2CDevice = pins.I2CDevice
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema({
|
@ -3,13 +3,13 @@ import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import core
|
||||
from esphomeyaml.components import display, font
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_FILE, CONF_ID, CONF_RESIZE
|
||||
from esphomeyaml.core import CORE, HexInt
|
||||
from esphomeyaml.cpp_generator import Pvariable, progmem_array, safe_exp
|
||||
from esphomeyaml.cpp_types import App, uint8
|
||||
from esphome import core
|
||||
from esphome.components import display, font
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_FILE, CONF_ID, CONF_RESIZE
|
||||
from esphome.core import CORE, HexInt
|
||||
from esphome.cpp_generator import Pvariable, progmem_array, safe_exp
|
||||
from esphome.cpp_types import App, uint8
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@ -37,7 +37,7 @@ def to_code(config):
|
||||
try:
|
||||
image = Image.open(path)
|
||||
except Exception as e:
|
||||
raise core.EsphomeyamlError(u"Could not load image file {}: {}".format(path, e))
|
||||
raise core.EsphomeError(u"Could not load image file {}: {}".format(path, e))
|
||||
|
||||
if CONF_RESIZE in config:
|
||||
image.thumbnail(config[CONF_RESIZE])
|
@ -1,13 +1,13 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import automation
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_INTERVAL
|
||||
from esphomeyaml.cpp_generator import Pvariable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, NoArg, PollingComponent, Trigger, esphomelib_ns
|
||||
from esphome import automation
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_INTERVAL
|
||||
from esphome.cpp_generator import Pvariable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, NoArg, PollingComponent, Trigger, esphome_ns
|
||||
|
||||
IntervalTrigger = esphomelib_ns.class_('IntervalTrigger', Trigger.template(NoArg), PollingComponent)
|
||||
IntervalTrigger = esphome_ns.class_('IntervalTrigger', Trigger.template(NoArg), PollingComponent)
|
||||
|
||||
CONFIG_SCHEMA = automation.validate_automation(vol.Schema({
|
||||
cv.GenerateID(): cv.declare_variable_id(IntervalTrigger),
|
@ -1,18 +1,18 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.automation import ACTION_REGISTRY, maybe_simple_id
|
||||
from esphomeyaml.components import mqtt
|
||||
from esphomeyaml.components.mqtt import setup_mqtt_component
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ALPHA, CONF_BLUE, CONF_BRIGHTNESS, CONF_COLORS, \
|
||||
from esphome.automation import ACTION_REGISTRY, maybe_simple_id
|
||||
from esphome.components import mqtt
|
||||
from esphome.components.mqtt import setup_mqtt_component
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ALPHA, CONF_BLUE, CONF_BRIGHTNESS, CONF_COLORS, \
|
||||
CONF_COLOR_TEMPERATURE, CONF_DEFAULT_TRANSITION_LENGTH, CONF_DURATION, CONF_EFFECT, \
|
||||
CONF_EFFECTS, CONF_EFFECT_ID, CONF_FLASH_LENGTH, CONF_GAMMA_CORRECT, CONF_GREEN, CONF_ID, \
|
||||
CONF_INTERNAL, CONF_LAMBDA, CONF_MQTT_ID, CONF_NAME, CONF_NUM_LEDS, CONF_RANDOM, CONF_RED, \
|
||||
CONF_SPEED, CONF_STATE, CONF_TRANSITION_LENGTH, CONF_UPDATE_INTERVAL, CONF_WHITE, CONF_WIDTH
|
||||
from esphomeyaml.core import CORE
|
||||
from esphomeyaml.cpp_generator import Pvariable, StructInitializer, add, get_variable, \
|
||||
process_lambda, templatable
|
||||
from esphomeyaml.cpp_types import Action, Application, Component, Nameable, esphomelib_ns, float_, \
|
||||
from esphome.core import CORE
|
||||
from esphome.cpp_generator import Pvariable, StructInitializer, add, get_variable, process_lambda, \
|
||||
templatable
|
||||
from esphome.cpp_types import Action, Application, Component, Nameable, esphome_ns, float_, \
|
||||
std_string, uint32, void
|
||||
|
||||
PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA.extend({
|
||||
@ -20,7 +20,7 @@ PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA.extend({
|
||||
})
|
||||
|
||||
# Base
|
||||
light_ns = esphomelib_ns.namespace('light')
|
||||
light_ns = esphome_ns.namespace('light')
|
||||
LightState = light_ns.class_('LightState', Nameable, Component)
|
||||
MakeLight = Application.struct('MakeLight')
|
||||
LightOutput = light_ns.class_('LightOutput')
|
@ -1,11 +1,11 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import light, output
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_EFFECTS, CONF_MAKE_ID, CONF_NAME, CONF_OUTPUT
|
||||
from esphomeyaml.cpp_generator import get_variable, variable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App
|
||||
from esphome.components import light, output
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_EFFECTS, CONF_MAKE_ID, CONF_NAME, CONF_OUTPUT
|
||||
from esphome.cpp_generator import get_variable, variable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App
|
||||
|
||||
PLATFORM_SCHEMA = cv.nameable(light.LIGHT_PLATFORM_SCHEMA.extend({
|
||||
cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(light.MakeLight),
|
@ -1,15 +1,15 @@
|
||||
import voluptuous as vol
|
||||
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.components import light, output
|
||||
from esphomeyaml.components.light.rgbww import validate_cold_white_colder, \
|
||||
from esphome.components import light, output
|
||||
from esphome.components.light.rgbww import validate_cold_white_colder, \
|
||||
validate_color_temperature
|
||||
from esphomeyaml.const import CONF_COLD_WHITE, CONF_COLD_WHITE_COLOR_TEMPERATURE, \
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_COLD_WHITE, CONF_COLD_WHITE_COLOR_TEMPERATURE, \
|
||||
CONF_DEFAULT_TRANSITION_LENGTH, CONF_EFFECTS, CONF_GAMMA_CORRECT, CONF_MAKE_ID, \
|
||||
CONF_NAME, CONF_WARM_WHITE, CONF_WARM_WHITE_COLOR_TEMPERATURE
|
||||
from esphomeyaml.cpp_generator import get_variable, variable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App
|
||||
from esphome.cpp_generator import get_variable, variable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App
|
||||
|
||||
PLATFORM_SCHEMA = cv.nameable(light.LIGHT_PLATFORM_SCHEMA.extend({
|
||||
cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(light.MakeLight),
|
@ -1,15 +1,15 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import light
|
||||
from esphomeyaml.components.power_supply import PowerSupplyComponent
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_CHIPSET, CONF_COLOR_CORRECT, CONF_DEFAULT_TRANSITION_LENGTH, \
|
||||
from esphome import pins
|
||||
from esphome.components import light
|
||||
from esphome.components.power_supply import PowerSupplyComponent
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_CHIPSET, CONF_COLOR_CORRECT, CONF_DEFAULT_TRANSITION_LENGTH, \
|
||||
CONF_EFFECTS, CONF_GAMMA_CORRECT, CONF_MAKE_ID, CONF_MAX_REFRESH_RATE, CONF_NAME, \
|
||||
CONF_NUM_LEDS, CONF_PIN, CONF_POWER_SUPPLY, CONF_RGB_ORDER
|
||||
from esphomeyaml.cpp_generator import RawExpression, TemplateArguments, add, get_variable, variable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, Application
|
||||
from esphome.cpp_generator import RawExpression, TemplateArguments, add, get_variable, variable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, Application
|
||||
|
||||
TYPES = [
|
||||
'NEOPIXEL',
|
@ -1,15 +1,15 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import light
|
||||
from esphomeyaml.components.power_supply import PowerSupplyComponent
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_CHIPSET, CONF_CLOCK_PIN, CONF_COLOR_CORRECT, CONF_DATA_PIN, \
|
||||
from esphome import pins
|
||||
from esphome.components import light
|
||||
from esphome.components.power_supply import PowerSupplyComponent
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_CHIPSET, CONF_CLOCK_PIN, CONF_COLOR_CORRECT, CONF_DATA_PIN, \
|
||||
CONF_DEFAULT_TRANSITION_LENGTH, CONF_EFFECTS, CONF_GAMMA_CORRECT, CONF_MAKE_ID, \
|
||||
CONF_MAX_REFRESH_RATE, CONF_NAME, CONF_NUM_LEDS, CONF_POWER_SUPPLY, CONF_RGB_ORDER
|
||||
from esphomeyaml.cpp_generator import RawExpression, TemplateArguments, add, get_variable, variable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, Application
|
||||
from esphome.cpp_generator import RawExpression, TemplateArguments, add, get_variable, variable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, Application
|
||||
|
||||
CHIPSETS = [
|
||||
'LPD8806',
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import light, output
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_DEFAULT_TRANSITION_LENGTH, CONF_EFFECTS, CONF_GAMMA_CORRECT, \
|
||||
from esphome.components import light, output
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_DEFAULT_TRANSITION_LENGTH, CONF_EFFECTS, CONF_GAMMA_CORRECT, \
|
||||
CONF_MAKE_ID, CONF_NAME, CONF_OUTPUT
|
||||
from esphomeyaml.cpp_generator import get_variable, variable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App
|
||||
from esphome.cpp_generator import get_variable, variable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App
|
||||
|
||||
PLATFORM_SCHEMA = cv.nameable(light.LIGHT_PLATFORM_SCHEMA.extend({
|
||||
cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(light.MakeLight),
|
@ -1,17 +1,17 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import light
|
||||
from esphomeyaml.components.light import AddressableLight
|
||||
from esphomeyaml.components.power_supply import PowerSupplyComponent
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_CLOCK_PIN, CONF_COLOR_CORRECT, CONF_DATA_PIN, \
|
||||
from esphome import pins
|
||||
from esphome.components import light
|
||||
from esphome.components.light import AddressableLight
|
||||
from esphome.components.power_supply import PowerSupplyComponent
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_CLOCK_PIN, CONF_COLOR_CORRECT, CONF_DATA_PIN, \
|
||||
CONF_DEFAULT_TRANSITION_LENGTH, CONF_EFFECTS, CONF_GAMMA_CORRECT, CONF_MAKE_ID, CONF_METHOD, \
|
||||
CONF_NAME, CONF_NUM_LEDS, CONF_PIN, CONF_POWER_SUPPLY, CONF_TYPE, CONF_VARIANT
|
||||
from esphomeyaml.core import CORE
|
||||
from esphomeyaml.cpp_generator import TemplateArguments, add, get_variable, variable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, Application, Component, global_ns
|
||||
from esphome.core import CORE
|
||||
from esphome.cpp_generator import TemplateArguments, add, get_variable, variable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, Application, Component, global_ns
|
||||
|
||||
NeoPixelBusLightOutputBase = light.light_ns.class_('NeoPixelBusLightOutputBase', Component,
|
||||
AddressableLight)
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import light, output
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_BLUE, CONF_DEFAULT_TRANSITION_LENGTH, CONF_EFFECTS, \
|
||||
from esphome.components import light, output
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_BLUE, CONF_DEFAULT_TRANSITION_LENGTH, CONF_EFFECTS, \
|
||||
CONF_GAMMA_CORRECT, CONF_GREEN, CONF_MAKE_ID, CONF_NAME, CONF_RED
|
||||
from esphomeyaml.cpp_generator import get_variable, variable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App
|
||||
from esphome.cpp_generator import get_variable, variable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App
|
||||
|
||||
PLATFORM_SCHEMA = cv.nameable(light.LIGHT_PLATFORM_SCHEMA.extend({
|
||||
cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(light.MakeLight),
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import light, output
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_BLUE, CONF_DEFAULT_TRANSITION_LENGTH, CONF_EFFECTS, \
|
||||
from esphome.components import light, output
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_BLUE, CONF_DEFAULT_TRANSITION_LENGTH, CONF_EFFECTS, \
|
||||
CONF_GAMMA_CORRECT, CONF_GREEN, CONF_MAKE_ID, CONF_NAME, CONF_RED, CONF_WHITE
|
||||
from esphomeyaml.cpp_generator import get_variable, variable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App
|
||||
from esphome.cpp_generator import get_variable, variable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App
|
||||
|
||||
PLATFORM_SCHEMA = cv.nameable(light.LIGHT_PLATFORM_SCHEMA.extend({
|
||||
cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(light.MakeLight),
|
@ -1,13 +1,13 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import light, output
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_BLUE, CONF_COLD_WHITE, CONF_COLD_WHITE_COLOR_TEMPERATURE, \
|
||||
from esphome.components import light, output
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_BLUE, CONF_COLD_WHITE, CONF_COLD_WHITE_COLOR_TEMPERATURE, \
|
||||
CONF_DEFAULT_TRANSITION_LENGTH, CONF_EFFECTS, CONF_GAMMA_CORRECT, CONF_GREEN, CONF_MAKE_ID, \
|
||||
CONF_NAME, CONF_RED, CONF_WARM_WHITE, CONF_WARM_WHITE_COLOR_TEMPERATURE
|
||||
from esphomeyaml.cpp_generator import get_variable, variable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App
|
||||
from esphome.cpp_generator import get_variable, variable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App
|
||||
|
||||
|
||||
def validate_color_temperature(value):
|
@ -2,23 +2,23 @@ import re
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.automation import ACTION_REGISTRY, LambdaAction
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ARGS, CONF_BAUD_RATE, CONF_FORMAT, CONF_ID, CONF_LEVEL, \
|
||||
CONF_LOGS, CONF_TAG, CONF_TX_BUFFER_SIZE, CONF_HARDWARE_UART
|
||||
from esphomeyaml.core import EsphomeyamlError, Lambda, CORE
|
||||
from esphomeyaml.cpp_generator import Pvariable, RawExpression, add, process_lambda, statement
|
||||
from esphomeyaml.cpp_types import App, Component, esphomelib_ns, global_ns, void
|
||||
from esphomeyaml.py_compat import text_type
|
||||
from esphome.automation import ACTION_REGISTRY, LambdaAction
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ARGS, CONF_BAUD_RATE, CONF_FORMAT, CONF_HARDWARE_UART, CONF_ID, \
|
||||
CONF_LEVEL, CONF_LOGS, CONF_TAG, CONF_TX_BUFFER_SIZE
|
||||
from esphome.core import CORE, EsphomeError, Lambda
|
||||
from esphome.cpp_generator import Pvariable, RawExpression, add, process_lambda, statement
|
||||
from esphome.cpp_types import App, Component, esphome_ns, global_ns, void
|
||||
from esphome.py_compat import text_type
|
||||
|
||||
LOG_LEVELS = {
|
||||
'NONE': global_ns.ESPHOMELIB_LOG_LEVEL_NONE,
|
||||
'ERROR': global_ns.ESPHOMELIB_LOG_LEVEL_ERROR,
|
||||
'WARN': global_ns.ESPHOMELIB_LOG_LEVEL_WARN,
|
||||
'INFO': global_ns.ESPHOMELIB_LOG_LEVEL_INFO,
|
||||
'DEBUG': global_ns.ESPHOMELIB_LOG_LEVEL_DEBUG,
|
||||
'VERBOSE': global_ns.ESPHOMELIB_LOG_LEVEL_VERBOSE,
|
||||
'VERY_VERBOSE': global_ns.ESPHOMELIB_LOG_LEVEL_VERY_VERBOSE,
|
||||
'NONE': global_ns.ESPHOME_LOG_LEVEL_NONE,
|
||||
'ERROR': global_ns.ESPHOME_LOG_LEVEL_ERROR,
|
||||
'WARN': global_ns.ESPHOME_LOG_LEVEL_WARN,
|
||||
'INFO': global_ns.ESPHOME_LOG_LEVEL_INFO,
|
||||
'DEBUG': global_ns.ESPHOME_LOG_LEVEL_DEBUG,
|
||||
'VERBOSE': global_ns.ESPHOME_LOG_LEVEL_VERBOSE,
|
||||
'VERY_VERBOSE': global_ns.ESPHOME_LOG_LEVEL_VERY_VERBOSE,
|
||||
}
|
||||
|
||||
LOG_LEVEL_TO_ESP_LOG = {
|
||||
@ -66,12 +66,12 @@ def validate_local_no_higher_than_global(value):
|
||||
global_level = value.get(CONF_LEVEL, 'DEBUG')
|
||||
for tag, level in value.get(CONF_LOGS, {}).items():
|
||||
if LOG_LEVEL_SEVERITY.index(level) > LOG_LEVEL_SEVERITY.index(global_level):
|
||||
raise EsphomeyamlError(u"The local log level {} for {} must be less severe than the "
|
||||
u"global log level {}.".format(level, tag, global_level))
|
||||
raise EsphomeError(u"The local log level {} for {} must be less severe than the "
|
||||
u"global log level {}.".format(level, tag, global_level))
|
||||
return value
|
||||
|
||||
|
||||
LogComponent = esphomelib_ns.class_('LogComponent', Component)
|
||||
LogComponent = esphome_ns.class_('LogComponent', Component)
|
||||
|
||||
CONFIG_SCHEMA = vol.All(vol.Schema({
|
||||
cv.GenerateID(): cv.declare_variable_id(LogComponent),
|
||||
@ -99,7 +99,7 @@ def to_code(config):
|
||||
def required_build_flags(config):
|
||||
flags = []
|
||||
if CONF_LEVEL in config:
|
||||
flags.append(u'-DESPHOMELIB_LOG_LEVEL={}'.format(str(LOG_LEVELS[config[CONF_LEVEL]])))
|
||||
flags.append(u'-DESPHOME_LOG_LEVEL={}'.format(str(LOG_LEVELS[config[CONF_LEVEL]])))
|
||||
this_severity = LOG_LEVEL_SEVERITY.index(config[CONF_LEVEL])
|
||||
verbose_severity = LOG_LEVEL_SEVERITY.index('VERBOSE')
|
||||
is_at_least_verbose = this_severity >= verbose_severity
|
@ -3,22 +3,22 @@ import re
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import automation
|
||||
from esphomeyaml.automation import ACTION_REGISTRY
|
||||
from esphomeyaml.components import logger
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_AVAILABILITY, CONF_BIRTH_MESSAGE, CONF_BROKER, CONF_CLIENT_ID, \
|
||||
from esphome import automation
|
||||
from esphome.automation import ACTION_REGISTRY
|
||||
from esphome.components import logger
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_AVAILABILITY, CONF_BIRTH_MESSAGE, CONF_BROKER, CONF_CLIENT_ID, \
|
||||
CONF_COMMAND_TOPIC, CONF_DISCOVERY, CONF_DISCOVERY_PREFIX, CONF_DISCOVERY_RETAIN, \
|
||||
CONF_ESPHOMEYAML, CONF_ID, CONF_INTERNAL, CONF_KEEPALIVE, CONF_LEVEL, CONF_LOG_TOPIC, \
|
||||
CONF_ESPHOME, CONF_ID, CONF_INTERNAL, CONF_KEEPALIVE, CONF_LEVEL, CONF_LOG_TOPIC, \
|
||||
CONF_MQTT, CONF_NAME, CONF_ON_JSON_MESSAGE, CONF_ON_MESSAGE, CONF_PASSWORD, CONF_PAYLOAD, \
|
||||
CONF_PAYLOAD_AVAILABLE, CONF_PAYLOAD_NOT_AVAILABLE, CONF_PORT, CONF_QOS, CONF_REBOOT_TIMEOUT, \
|
||||
CONF_RETAIN, CONF_SHUTDOWN_MESSAGE, CONF_SSL_FINGERPRINTS, CONF_STATE_TOPIC, CONF_TOPIC, \
|
||||
CONF_TOPIC_PREFIX, CONF_TRIGGER_ID, CONF_USERNAME, CONF_WILL_MESSAGE
|
||||
from esphomeyaml.core import EsphomeyamlError
|
||||
from esphomeyaml.cpp_generator import Pvariable, RawExpression, StructInitializer, \
|
||||
TemplateArguments, add, process_lambda, templatable, get_variable
|
||||
from esphomeyaml.cpp_types import Action, App, Component, JsonObjectConstRef, JsonObjectRef, \
|
||||
Trigger, bool_, esphomelib_ns, optional, std_string, uint8, void
|
||||
from esphome.core import EsphomeError
|
||||
from esphome.cpp_generator import Pvariable, RawExpression, StructInitializer, TemplateArguments, \
|
||||
add, get_variable, process_lambda, templatable
|
||||
from esphome.cpp_types import Action, App, Component, JsonObjectConstRef, JsonObjectRef, \
|
||||
Trigger, bool_, esphome_ns, optional, std_string, uint8, void
|
||||
|
||||
|
||||
def validate_message_just_topic(value):
|
||||
@ -38,7 +38,7 @@ MQTT_MESSAGE_SCHEMA = vol.Any(None, MQTT_MESSAGE_BASE.extend({
|
||||
vol.Required(CONF_PAYLOAD): cv.mqtt_payload,
|
||||
}))
|
||||
|
||||
mqtt_ns = esphomelib_ns.namespace('mqtt')
|
||||
mqtt_ns = esphome_ns.namespace('mqtt')
|
||||
MQTTMessage = mqtt_ns.struct('MQTTMessage')
|
||||
MQTTClientComponent = mqtt_ns.class_('MQTTClientComponent', Component)
|
||||
MQTTPublishAction = mqtt_ns.class_('MQTTPublishAction', Action)
|
||||
@ -299,10 +299,10 @@ def build_hass_config(data, component_type, config, include_state=True, include_
|
||||
class GenerateHassConfigData(object):
|
||||
def __init__(self, config):
|
||||
if 'mqtt' not in config:
|
||||
raise EsphomeyamlError("Cannot generate Home Assistant MQTT config if MQTT is not "
|
||||
"used!")
|
||||
raise EsphomeError("Cannot generate Home Assistant MQTT config if MQTT is not "
|
||||
"used!")
|
||||
mqtt = config[CONF_MQTT]
|
||||
self.topic_prefix = mqtt.get(CONF_TOPIC_PREFIX, config[CONF_ESPHOMEYAML][CONF_NAME])
|
||||
self.topic_prefix = mqtt.get(CONF_TOPIC_PREFIX, config[CONF_ESPHOME][CONF_NAME])
|
||||
birth_message = mqtt.get(CONF_BIRTH_MESSAGE)
|
||||
if CONF_BIRTH_MESSAGE not in mqtt:
|
||||
birth_message = {
|
@ -1,13 +1,13 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import output
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import (CONF_BIT_DEPTH, CONF_CLOCK_PIN, CONF_DATA_PIN, CONF_ID,
|
||||
CONF_NUM_CHANNELS, CONF_NUM_CHIPS, CONF_UPDATE_ON_BOOT)
|
||||
from esphomeyaml.cpp_generator import Pvariable, add
|
||||
from esphomeyaml.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphomeyaml.cpp_types import App, Component
|
||||
from esphome import pins
|
||||
from esphome.components import output
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import (CONF_BIT_DEPTH, CONF_CLOCK_PIN, CONF_DATA_PIN, CONF_ID,
|
||||
CONF_NUM_CHANNELS, CONF_NUM_CHIPS, CONF_UPDATE_ON_BOOT)
|
||||
from esphome.cpp_generator import Pvariable, add
|
||||
from esphome.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphome.cpp_types import App, Component
|
||||
|
||||
MY9231OutputComponent = output.output_ns.class_('MY9231OutputComponent', Component)
|
||||
MULTI_CONF = True
|
@ -2,15 +2,15 @@ import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_OTA, CONF_PASSWORD, CONF_PORT, CONF_SAFE_MODE
|
||||
from esphomeyaml.core import CORE
|
||||
from esphomeyaml.cpp_generator import Pvariable, add
|
||||
from esphomeyaml.cpp_types import App, Component, esphomelib_ns
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_OTA, CONF_PASSWORD, CONF_PORT, CONF_SAFE_MODE
|
||||
from esphome.core import CORE
|
||||
from esphome.cpp_generator import Pvariable, add
|
||||
from esphome.cpp_types import App, Component, esphome_ns
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
OTAComponent = esphomelib_ns.class_('OTAComponent', Component)
|
||||
OTAComponent = esphome_ns.class_('OTAComponent', Component)
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema({
|
||||
cv.GenerateID(): cv.declare_variable_id(OTAComponent),
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.automation import maybe_simple_id, ACTION_REGISTRY
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.components.power_supply import PowerSupplyComponent
|
||||
from esphomeyaml.const import CONF_INVERTED, CONF_MAX_POWER, CONF_POWER_SUPPLY, CONF_ID, CONF_LEVEL
|
||||
from esphomeyaml.core import CORE
|
||||
from esphomeyaml.cpp_generator import add, get_variable, Pvariable, templatable
|
||||
from esphomeyaml.cpp_types import esphomelib_ns, Action, float_
|
||||
from esphome.automation import ACTION_REGISTRY, maybe_simple_id
|
||||
from esphome.components.power_supply import PowerSupplyComponent
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_INVERTED, CONF_LEVEL, CONF_MAX_POWER, CONF_POWER_SUPPLY
|
||||
from esphome.core import CORE
|
||||
from esphome.cpp_generator import Pvariable, add, get_variable, templatable
|
||||
from esphome.cpp_types import Action, esphome_ns, float_
|
||||
|
||||
PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA.extend({
|
||||
|
||||
@ -25,7 +25,7 @@ FLOAT_OUTPUT_SCHEMA = BINARY_OUTPUT_SCHEMA.extend({
|
||||
|
||||
FLOAT_OUTPUT_PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(FLOAT_OUTPUT_SCHEMA.schema)
|
||||
|
||||
output_ns = esphomelib_ns.namespace('output')
|
||||
output_ns = esphome_ns.namespace('output')
|
||||
BinaryOutput = output_ns.class_('BinaryOutput')
|
||||
BinaryOutputPtr = BinaryOutput.operator('ptr')
|
||||
FloatOutput = output_ns.class_('FloatOutput', BinaryOutput)
|
||||
@ -60,7 +60,6 @@ def register_output(var, config):
|
||||
|
||||
BUILD_FLAGS = '-DUSE_OUTPUT'
|
||||
|
||||
|
||||
CONF_OUTPUT_TURN_ON = 'output.turn_on'
|
||||
OUTPUT_TURN_ON_ACTION = maybe_simple_id({
|
||||
vol.Required(CONF_ID): cv.use_variable_id(BinaryOutput),
|
@ -1,10 +1,10 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import output
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_LAMBDA, CONF_OUTPUTS, CONF_TYPE
|
||||
from esphomeyaml.cpp_generator import process_lambda, variable
|
||||
from esphomeyaml.cpp_types import std_vector
|
||||
from esphome.components import output
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_LAMBDA, CONF_OUTPUTS, CONF_TYPE
|
||||
from esphome.cpp_generator import process_lambda, variable
|
||||
from esphome.cpp_types import std_vector
|
||||
|
||||
CustomBinaryOutputConstructor = output.output_ns.class_('CustomBinaryOutputConstructor')
|
||||
CustomFloatOutputConstructor = output.output_ns.class_('CustomFloatOutputConstructor')
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import output
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_FREQUENCY, CONF_ID, CONF_NUMBER, CONF_PIN, ESP_PLATFORM_ESP8266
|
||||
from esphomeyaml.cpp_generator import Pvariable, add
|
||||
from esphomeyaml.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphomeyaml.cpp_types import App, Component
|
||||
from esphome import pins
|
||||
from esphome.components import output
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_FREQUENCY, CONF_ID, CONF_NUMBER, CONF_PIN, ESP_PLATFORM_ESP8266
|
||||
from esphome.cpp_generator import Pvariable, add
|
||||
from esphome.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphome.cpp_types import App, Component
|
||||
|
||||
ESP_PLATFORMS = [ESP_PLATFORM_ESP8266]
|
||||
|
@ -1,12 +1,12 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import output
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ID, CONF_PIN
|
||||
from esphomeyaml.cpp_generator import Pvariable
|
||||
from esphomeyaml.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphomeyaml.cpp_types import App, Component
|
||||
from esphome import pins
|
||||
from esphome.components import output
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_PIN
|
||||
from esphome.cpp_generator import Pvariable
|
||||
from esphome.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphome.cpp_types import App, Component
|
||||
|
||||
GPIOBinaryOutputComponent = output.output_ns.class_('GPIOBinaryOutputComponent',
|
||||
output.BinaryOutput, Component)
|
@ -1,13 +1,13 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
from esphomeyaml.components import output
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import APB_CLOCK_FREQ, CONF_BIT_DEPTH, CONF_CHANNEL, CONF_FREQUENCY, \
|
||||
from esphome import pins
|
||||
from esphome.components import output
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import APB_CLOCK_FREQ, CONF_BIT_DEPTH, CONF_CHANNEL, CONF_FREQUENCY, \
|
||||
CONF_ID, CONF_PIN, ESP_PLATFORM_ESP32
|
||||
from esphomeyaml.cpp_generator import Pvariable, add
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, Component
|
||||
from esphome.cpp_generator import Pvariable, add
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, Component
|
||||
|
||||
ESP_PLATFORMS = [ESP_PLATFORM_ESP32]
|
||||
|
@ -1,11 +1,11 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import output
|
||||
from esphomeyaml.components.my9231 import MY9231OutputComponent
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_CHANNEL, CONF_ID, CONF_MY9231_ID, CONF_POWER_SUPPLY
|
||||
from esphomeyaml.cpp_generator import Pvariable, get_variable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphome.components import output
|
||||
from esphome.components.my9231 import MY9231OutputComponent
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_CHANNEL, CONF_ID, CONF_MY9231_ID, CONF_POWER_SUPPLY
|
||||
from esphome.cpp_generator import Pvariable, get_variable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
|
||||
DEPENDENCIES = ['my9231']
|
||||
|
@ -1,10 +1,10 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import output
|
||||
from esphomeyaml.components.pca9685 import PCA9685OutputComponent
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_CHANNEL, CONF_ID, CONF_PCA9685_ID, CONF_POWER_SUPPLY
|
||||
from esphomeyaml.cpp_generator import Pvariable, get_variable
|
||||
from esphome.components import output
|
||||
from esphome.components.pca9685 import PCA9685OutputComponent
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_CHANNEL, CONF_ID, CONF_PCA9685_ID, CONF_POWER_SUPPLY
|
||||
from esphome.cpp_generator import Pvariable, get_variable
|
||||
|
||||
DEPENDENCIES = ['pca9685']
|
||||
|
@ -1,11 +1,11 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import i2c, output
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ADDRESS, CONF_FREQUENCY, CONF_ID
|
||||
from esphomeyaml.cpp_generator import Pvariable, add
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, Component
|
||||
from esphome.components import i2c, output
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ADDRESS, CONF_FREQUENCY, CONF_ID
|
||||
from esphome.cpp_generator import Pvariable, add
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, Component
|
||||
|
||||
DEPENDENCIES = ['i2c']
|
||||
MULTI_CONF = True
|
@ -1,11 +1,11 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import pins
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_ADDRESS, CONF_ID, CONF_PCF8575
|
||||
from esphomeyaml.cpp_generator import Pvariable
|
||||
from esphomeyaml.cpp_helpers import setup_component
|
||||
from esphomeyaml.cpp_types import App, GPIOInputPin, GPIOOutputPin, io_ns
|
||||
from esphome import pins
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ADDRESS, CONF_ID, CONF_PCF8575
|
||||
from esphome.cpp_generator import Pvariable
|
||||
from esphome.cpp_helpers import setup_component
|
||||
from esphome.cpp_types import App, GPIOInputPin, GPIOOutputPin, io_ns
|
||||
|
||||
DEPENDENCIES = ['i2c']
|
||||
MULTI_CONF = True
|
@ -1,14 +1,14 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml import automation, pins
|
||||
from esphomeyaml.components import binary_sensor, spi
|
||||
from esphomeyaml.components.spi import SPIComponent
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.const import CONF_CS_PIN, CONF_ID, CONF_ON_TAG, CONF_SPI_ID, CONF_TRIGGER_ID, \
|
||||
from esphome import automation, pins
|
||||
from esphome.components import binary_sensor, spi
|
||||
from esphome.components.spi import SPIComponent
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_CS_PIN, CONF_ID, CONF_ON_TAG, CONF_SPI_ID, CONF_TRIGGER_ID, \
|
||||
CONF_UPDATE_INTERVAL
|
||||
from esphomeyaml.cpp_generator import Pvariable, get_variable
|
||||
from esphomeyaml.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphomeyaml.cpp_types import App, PollingComponent, Trigger, std_string
|
||||
from esphome.cpp_generator import Pvariable, get_variable
|
||||
from esphome.cpp_helpers import gpio_output_pin_expression, setup_component
|
||||
from esphome.cpp_types import App, PollingComponent, Trigger, std_string
|
||||
|
||||
DEPENDENCIES = ['spi']
|
||||
MULTI_CONF = True
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user