From 587bae7608c7e2889e65e07504b0ba2c924d2ed0 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sat, 10 Nov 2018 15:32:49 +0100 Subject: [PATCH 01/35] Bump version to v1.9.0b4 --- Doxygen | 2 +- Makefile | 2 +- conf.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Doxygen b/Doxygen index 41e351ab2..8baade48d 100644 --- a/Doxygen +++ b/Doxygen @@ -38,7 +38,7 @@ PROJECT_NAME = "esphomelib" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.9.0b3 +PROJECT_NUMBER = 1.9.0b4 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Makefile b/Makefile index 2e9a3c005..63f856827 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ SPHINXPROJ = esphomelib SOURCEDIR = . BUILDDIR = _build ESPHOMELIB_PATH = ../esphomelib -ESPHOMELIB_TAG = v1.9.0b3 +ESPHOMELIB_TAG = v1.9.0b4 CNAME = esphomelib.com .PHONY: html cleanhtml doxyg cleandoxyg deploy help webserver Makefile $(ESPHOMELIB_PATH) diff --git a/conf.py b/conf.py index cf8c6d7bd..766f8c7ee 100644 --- a/conf.py +++ b/conf.py @@ -74,7 +74,7 @@ author = 'Otto Winter' # The short X.Y version. version = '1.9' # The full version, including alpha/beta/rc tags. -release = '1.9.0b3' +release = '1.9.0b4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From e2e27227069214b95acd107420e7abc0e657c82b Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 12 Nov 2018 23:44:41 +0100 Subject: [PATCH 02/35] Bump version to v1.9.0b5 --- Doxygen | 2 +- Makefile | 2 +- conf.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Doxygen b/Doxygen index 8baade48d..7983bc147 100644 --- a/Doxygen +++ b/Doxygen @@ -38,7 +38,7 @@ PROJECT_NAME = "esphomelib" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.9.0b4 +PROJECT_NUMBER = 1.9.0b5 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Makefile b/Makefile index 63f856827..a36cf6c27 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ SPHINXPROJ = esphomelib SOURCEDIR = . BUILDDIR = _build ESPHOMELIB_PATH = ../esphomelib -ESPHOMELIB_TAG = v1.9.0b4 +ESPHOMELIB_TAG = v1.9.0b5 CNAME = esphomelib.com .PHONY: html cleanhtml doxyg cleandoxyg deploy help webserver Makefile $(ESPHOMELIB_PATH) diff --git a/conf.py b/conf.py index 766f8c7ee..bd076bb27 100644 --- a/conf.py +++ b/conf.py @@ -74,7 +74,7 @@ author = 'Otto Winter' # The short X.Y version. version = '1.9' # The full version, including alpha/beta/rc tags. -release = '1.9.0b4' +release = '1.9.0b5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From 20c123971103e40de09e7cf5b04bc5150d76caa5 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Tue, 13 Nov 2018 19:10:19 +0100 Subject: [PATCH 03/35] Bump version to v1.9.0b6 --- Doxygen | 2 +- Makefile | 2 +- conf.py | 2 +- esphomeyaml/changelog/index.rst | 11 ++++++++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Doxygen b/Doxygen index 7983bc147..1d5f7a12a 100644 --- a/Doxygen +++ b/Doxygen @@ -38,7 +38,7 @@ PROJECT_NAME = "esphomelib" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.9.0b5 +PROJECT_NUMBER = 1.9.0b6 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Makefile b/Makefile index a36cf6c27..86a01d909 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ SPHINXPROJ = esphomelib SOURCEDIR = . BUILDDIR = _build ESPHOMELIB_PATH = ../esphomelib -ESPHOMELIB_TAG = v1.9.0b5 +ESPHOMELIB_TAG = v1.9.0b6 CNAME = esphomelib.com .PHONY: html cleanhtml doxyg cleandoxyg deploy help webserver Makefile $(ESPHOMELIB_PATH) diff --git a/conf.py b/conf.py index bd076bb27..dbc3155ec 100644 --- a/conf.py +++ b/conf.py @@ -74,7 +74,7 @@ author = 'Otto Winter' # The short X.Y version. version = '1.9' # The full version, including alpha/beta/rc tags. -release = '1.9.0b5' +release = '1.9.0b6' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/esphomeyaml/changelog/index.rst b/esphomeyaml/changelog/index.rst index f26374434..4572387d7 100644 --- a/esphomeyaml/changelog/index.rst +++ b/esphomeyaml/changelog/index.rst @@ -233,7 +233,9 @@ All changes - yaml: Add Stepper Motor Support :yamlpr:`206` (new-feature) - yaml: Add send_first_at option to sliding window sensor filter :yamlpr:`207` (new-feature) - docs: Switch example to Dehumidifier, minor grammar/puncuation :docspr:`67` by :ghuser:`rorpage` +- docs: Tiny typo fix. :docspr:`73` by :ghuser:`corbanmailloux` - yaml: Auto-Decode stacktraces :yamlpr:`214` (new-feature) +- docs: Fix a broken link to setting up a BLE tracker. :docspr:`72` by :ghuser:`corbanmailloux` - yaml: Add generate home assistant config command :yamlpr:`208` (new-feature) - yaml: Update Gitlab Build Script :yamlpr:`215` - lib: Fix status binary sensor always reporting false internally :libpr:`257` @@ -258,7 +260,14 @@ All changes - lib: Add Total Daily Energy Sensor :libpr:`256` (new-feature) - yaml: Add total daily energy sensor :yamlpr:`220` (new-feature) - docs: Add total daily energy sensor :docspr:`79` - +- lib: Introduce new setup phase: "dump config" to allow fully-offline operation :libpr:`267` +- yaml: Let esphomeyaml know about class inheritance :yamlpr:`229` +- docs: ESP32 deep sleep wake up multiple pins :docspr:`81` +- yaml: Deep Sleep Wake Up From Multiple Pins :yamlpr:`230` +- lib: Deep Sleep Multi Wakeup :libpr:`268` +- lib: MY9231/MY9291 LED driver support :libpr:`266` by :ghuser:`puuu` (new-feature) +- yaml: Add MY9231 support :yamlpr:`227` by :ghuser:`puuu` (new-feature) +- docs: MY9231/MY9291 LED driver documentation :docspr:`80` by :ghuser:`puuu` (new-feature) Past Changelogs From 96eb52f079df78c04929b44e82eae7306a8ab754 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Wed, 14 Nov 2018 22:25:20 +0100 Subject: [PATCH 04/35] Fix --- esphomeyaml/changelog/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphomeyaml/changelog/index.rst b/esphomeyaml/changelog/index.rst index 5ff87d2db..f0b3bd150 100644 --- a/esphomeyaml/changelog/index.rst +++ b/esphomeyaml/changelog/index.rst @@ -3,7 +3,7 @@ Changelog - Version 1.9.0 .. seo:: :description: Changelog for esphomelib version 1.9.0. - :image: /_static/_changelog-1.9.0.png + :image: /_static/changelog-1.9.0.png :author: Otto Winter :author_twitter: @OttoWinter_ From c0c84098f62f1c9db815172170110b738e4ce668 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Thu, 15 Nov 2018 12:07:12 +0100 Subject: [PATCH 05/35] Bump version to v1.9.0 --- Doxygen | 2 +- Makefile | 2 +- conf.py | 2 +- esphomeyaml/changelog/index.rst | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Doxygen b/Doxygen index 1d5f7a12a..60f731554 100644 --- a/Doxygen +++ b/Doxygen @@ -38,7 +38,7 @@ PROJECT_NAME = "esphomelib" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.9.0b6 +PROJECT_NUMBER = 1.9.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Makefile b/Makefile index 86a01d909..8e828d870 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ SPHINXPROJ = esphomelib SOURCEDIR = . BUILDDIR = _build ESPHOMELIB_PATH = ../esphomelib -ESPHOMELIB_TAG = v1.9.0b6 +ESPHOMELIB_TAG = v1.9.0 CNAME = esphomelib.com .PHONY: html cleanhtml doxyg cleandoxyg deploy help webserver Makefile $(ESPHOMELIB_PATH) diff --git a/conf.py b/conf.py index 0d150dee1..63c0b9609 100644 --- a/conf.py +++ b/conf.py @@ -75,7 +75,7 @@ author = 'Otto Winter' # The short X.Y version. version = '1.9' # The full version, including alpha/beta/rc tags. -release = '1.9.0b6' +release = '1.9.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/esphomeyaml/changelog/index.rst b/esphomeyaml/changelog/index.rst index 3997edf9b..8ccdf9d3f 100644 --- a/esphomeyaml/changelog/index.rst +++ b/esphomeyaml/changelog/index.rst @@ -296,6 +296,7 @@ All changes - lib: MY9231/MY9291 LED driver support :libpr:`266` by :ghuser:`puuu` (new-feature) - yaml: Add MY9231 support :yamlpr:`227` by :ghuser:`puuu` (new-feature) - docs: MY9231/MY9291 LED driver documentation :docspr:`80` by :ghuser:`puuu` (new-feature) +- docs: SEO Optimization :docspr:`82` Past Changelogs From e5c9a6000962ef1980df2b914164a409ab5d86e9 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Thu, 15 Nov 2018 13:05:59 +0100 Subject: [PATCH 06/35] Fix typo --- esphomeyaml/changelog/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphomeyaml/changelog/index.rst b/esphomeyaml/changelog/index.rst index 8ccdf9d3f..46f7c87b6 100644 --- a/esphomeyaml/changelog/index.rst +++ b/esphomeyaml/changelog/index.rst @@ -91,7 +91,7 @@ New Features or higher you will see a list of all components for each esphomelib node in the integrations screen (:libpr:`233`). -- The current esphomelib version and compilation time are no printed on each boot +- The current esphomelib version and compilation time are now printed on each boot (:libpr:`189`, :yamlpr:`159`): .. code:: bash From 473e4599abbedc178097d28b3ec863801ccaef42 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Thu, 15 Nov 2018 13:36:01 +0100 Subject: [PATCH 07/35] Update --- index.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.rst b/index.rst index 44bdf5391..36c897de4 100644 --- a/index.rst +++ b/index.rst @@ -1,6 +1,9 @@ esphomelib ========== +.. meta:: + :google-site-verification: qclmMpSERA2uy_ZceVgL6ijwkeEHer75LEPyyTQnK4E + .. seo:: :description: esphomeyaml Homepage - Reimagining DIY Home Automation :image: /_static/logo-full.png From 433cefc3ef63d3a1866cb64914f2b543e1c35602 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Thu, 15 Nov 2018 13:57:53 +0100 Subject: [PATCH 08/35] Add sitemap --- conf.py | 1 + sitemap.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 sitemap.py diff --git a/conf.py b/conf.py index 63c0b9609..6da0f8ba4 100644 --- a/conf.py +++ b/conf.py @@ -45,6 +45,7 @@ extensions = [ 'disqus', 'github', 'seo', + 'sitemap', ] breathe_projects = {"esphomelib": "./_doxyxml/"} diff --git a/sitemap.py b/sitemap.py new file mode 100644 index 000000000..9f140e20f --- /dev/null +++ b/sitemap.py @@ -0,0 +1,54 @@ +# Copyright (c) 2013 Michael Dowling +# Copyright (c) 2017 Jared Dillard +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +import xml.etree.ElementTree as ET +from sphinx.writers.html import HTMLTranslator + + +def setup(app): + """Setup connects events to the sitemap builder""" + app.connect('html-page-context', add_html_link) + app.connect('build-finished', create_sitemap) + app.sitemap_links = [] + + +def add_html_link(app, pagename, templatename, context, doctree): + """As each page is built, collect page names for the sitemap""" + app.sitemap_links.append(pagename + ".html") + + +def create_sitemap(app, exception): + """Generates the sitemap.xml from the collected HTML page links""" + root = ET.Element("urlset") + root.set("xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9") + root.set("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance") + root.set("xsi:schemaLocation", "http://www.sitemaps.org/schemas/sitemap/0.9 \ + http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd") + + for link in app.sitemap_links: + url = ET.SubElement(root, "url") + ET.SubElement(url, "loc").text = app.builder.config.html_baseurl + '/' + link + priority = 0.5 + if link.endswith('index.html'): + priority += 0.25 + if 'api' in link: + priority -= 0.25 + if link == 'esphomeyaml/index.html': + priority = 1.0 + ET.SubElement(url, "priority").text = str(priority) + + filename = app.outdir + "/sitemap.xml" + ET.ElementTree(root).write(filename, + xml_declaration=True, + encoding='utf-8', + method="xml") From a70f7bdff0c2bdcbd494f3c3e61c468c6443edb4 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Thu, 15 Nov 2018 20:13:28 +0100 Subject: [PATCH 09/35] Update Generic Sonoff page --- esphomeyaml/components/my9231.rst | 4 +- esphomeyaml/devices/sonoff.rst | 488 ++++++++++++++---------------- github.py | 67 ++++ 3 files changed, 301 insertions(+), 258 deletions(-) diff --git a/esphomeyaml/components/my9231.rst b/esphomeyaml/components/my9231.rst index 310b1f84c..ad6f03cc2 100644 --- a/esphomeyaml/components/my9231.rst +++ b/esphomeyaml/components/my9231.rst @@ -106,8 +106,8 @@ complete configuration for a Sonoff B1 looks like: password: my9231: - data_pin: GPIO12 - clock_pin: GPIO14 + data_pin: GPIO12 # GPIO13 for AiLight + clock_pin: GPIO14 # GPIO15 for AiLight num_channels: 6 num_chips: 2 diff --git a/esphomeyaml/devices/sonoff.rst b/esphomeyaml/devices/sonoff.rst index e1aba6319..1796906b2 100644 --- a/esphomeyaml/devices/sonoff.rst +++ b/esphomeyaml/devices/sonoff.rst @@ -28,287 +28,263 @@ https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/sonoff_templat Sonoff RF --------- -.. table:: - :class: no-center +.. pintable:: - ================================================== ================================================== - ``GPIO0`` Button (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO1`` ``RX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO3`` ``TX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO4`` Optional Sensor - -------------------------------------------------- -------------------------------------------------- - ``GPIO12`` Relay and Red LED - -------------------------------------------------- -------------------------------------------------- - ``GPIO13`` Green LED (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO14`` Optional Sensor - ================================================== ================================================== + GPIO0, Button (inverted), + GPIO12, Relay and Red LED, + GPIO13, Green LED (inverted), + GPIO1, UART RX pin (for external sensors) + GPIO3, UART TX pin (for external sensors) + GPIO4, Optional sensor + GPIO14, Optional sensor Sonoff SV --------- -.. table:: - :class: no-center +.. pintable:: - ================================================== ================================================== - ``GPIO0`` Button (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO1`` ``RX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO3`` ``TX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO4`` Optional Sensor - -------------------------------------------------- -------------------------------------------------- - ``GPIO5`` Optional Sensor - -------------------------------------------------- -------------------------------------------------- - ``GPIO12`` Relay and Red LED - -------------------------------------------------- -------------------------------------------------- - ``GPIO13`` Green LED (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO14`` Optional Sensor - -------------------------------------------------- -------------------------------------------------- - ``GPIO17`` Analog Input - ================================================== ================================================== + GPIO0, Button (inverted), + GPIO12, Relay and Red LED, + GPIO13, Green LED (inverted), + GPIO17, Analog Input, + GPIO1, UART RX pin (for external sensors) + GPIO3, UART TX pin (for external sensors) + GPIO4, Optional sensor + GPIO5, Optional sensor + GPIO14, Optional sensor -Sonoff TH ---------- +Sonoff TH10/TH16 +---------------- -.. table:: - :class: no-center +.. pintable:: - ================================================== ================================================== - ``GPIO0`` Button (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO1`` ``RX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO3`` ``TX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO4`` Optional Sensor - -------------------------------------------------- -------------------------------------------------- - ``GPIO12`` Relay and Red LED - -------------------------------------------------- -------------------------------------------------- - ``GPIO13`` Green LED (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO14`` Optional Sensor - ================================================== ================================================== + GPIO0, Button (inverted), + GPIO12, Relay and Red LED, + GPIO13, Green LED (inverted), + GPIO1, UART RX pin (for external sensors) + GPIO3, UART TX pin (for external sensors) + GPIO4, Optional sensor + GPIO14, Optional sensor +Sonoff Dual R1 +-------------- -Slampher --------- - -.. table:: - :class: no-center - - ================================================== ================================================== - ``GPIO0`` Button (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO1`` ``RX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO3`` ``TX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO12`` Relay and Red LED - -------------------------------------------------- -------------------------------------------------- - ``GPIO13`` Blue LED (inverted) - ================================================== ================================================== - - -Sonoff Touch ------------- - -.. table:: - :class: no-center - - ================================================== ================================================== - ``GPIO0`` Button (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO1`` ``RX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO3`` ``TX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO12`` Relay and Red LED - -------------------------------------------------- -------------------------------------------------- - ``GPIO13`` Blue LED (inverted) - ================================================== ================================================== - - -Sonoff LED ----------- - -.. table:: - :class: no-center - - ================================================== ================================================== - ``GPIO0`` Button (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO4`` Green Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO5`` Red Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO12`` Cold White Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO13`` Blue LED (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO14`` Warm White Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO15`` Blue Channel - ================================================== ================================================== - - -Sonoff T1, Sonoff T2, Sonoff T3 -------------------------------- - -.. table:: - :class: no-center - - ================================================== ================================================== - ``GPIO0`` Button #1 (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO1`` ``RX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO2`` Optional Sensor - -------------------------------------------------- -------------------------------------------------- - ``GPIO3`` ``TX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO4`` Relay #3 and Blue LED - -------------------------------------------------- -------------------------------------------------- - ``GPIO5`` Relay #2 and Blue LED - -------------------------------------------------- -------------------------------------------------- - ``GPIO9`` Button #2 (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO10`` Button #3 (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO12`` Relay #1 and Blue LED - -------------------------------------------------- -------------------------------------------------- - ``GPIO13`` Blue LED (inverted) - ================================================== ================================================== - - -Arilux LC01 ------------ - -.. table:: - :class: no-center - - ================================================== ================================================== - ``GPIO0`` Optional Button - -------------------------------------------------- -------------------------------------------------- - ``GPIO1`` ``RX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO2`` RF receiver (unsupported yet) - -------------------------------------------------- -------------------------------------------------- - ``GPIO3`` ``TX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO5`` Red Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO12`` Green Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO13`` Blue Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO14`` White Channel - ================================================== ================================================== - - -Arilux LC11 ------------ - -.. table:: - :class: no-center - - ================================================== ================================================== - ``GPIO0`` Optional Button - -------------------------------------------------- -------------------------------------------------- - ``GPIO1`` ``RX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO2`` RF receiver (unsupported yet) - -------------------------------------------------- -------------------------------------------------- - ``GPIO3`` ``TX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO4`` Green Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO5`` Red Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO12`` Warm White Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO13`` Cold White Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO14`` Blue Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO15`` RF Receiver (unsupported yet) - ================================================== ================================================== - - -Arilux LC06 ------------ - -.. table:: - :class: no-center - - ================================================== ================================================== - ``GPIO0`` Optional Button - -------------------------------------------------- -------------------------------------------------- - ``GPIO1`` ``RX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO3`` ``TX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO12`` Green Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO13`` Blue Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO14`` Red Channel - -------------------------------------------------- -------------------------------------------------- - ``GPIO15`` White Channel - ================================================== ================================================== +.. pintable:: + GPIO1, Relay #1, + GPIO3, Relay #2, + GPIO13, Blue LED (inverted), + GPIO4, Optional sensor + GPIO14, Optional sensor Sonoff Dual R2 -------------- -.. table:: - :class: no-center +.. pintable:: - ================================================== ================================================== - ``GPIO0`` Button 0 on header (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO1`` ``RX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO3`` ``TX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO5`` Relay #2 - -------------------------------------------------- -------------------------------------------------- - ``GPIO9`` Button 1 on header (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO10`` Button on casing (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO12`` Relay #1 - -------------------------------------------------- -------------------------------------------------- - ``GPIO13`` Blue LED (inverted) - ================================================== ================================================== + GPIO12, Relay #1, + GPIO5, Relay #2, + GPIO10, Button, + GPIO13, Blue LED (inverted), + GPIO4, Optional sensor + GPIO14, Optional sensor +Sonoff Pow R1 +------------- + +(equivalent to Huafan SS) + +.. pintable:: + + GPIO0, Button (inverted), + GPIO12, Relay and Red LED, + GPIO15, Blue LED, + + GPIO5, HLW8012 SEL Pin + GPIO13, HLW8012 CF1 Pin + GPIO14, HLW8012 CF Pin + +See :doc:`/esphomeyaml/components/sensor/hlw8012` for measuring power. + +Sonoff Pow R2 +------------- + +(equivalent to Huafan SS) + +.. pintable:: + + GPIO0, Button (inverted), + GPIO12, Relay and Red LED, + GPIO13, Blue LED (inverted), + +See :doc:`/esphomeyaml/components/sensor/cse7766` for measuring power. + +Sonoff S20, Sonoff S22, Sonoff S26 +---------------------------------- + +See :doc:`sonoff_s20`. + +Slampher +-------- + +.. pintable:: + + GPIO0, Button (inverted), + GPIO3, Relay and Red LED, + GPIO13, Blue LED (inverted), + GPIO1, UART RX pin (for external sensors) + GPIO3, UART TX pin (for external sensors) + +Sonoff Touch +------------ + +.. pintable:: + + GPIO0, Button (inverted), + GPIO12, Relay and Red LED, + GPIO13, Blue LED (inverted), + GPIO1, UART RX pin (for external sensors) + GPIO3, UART TX pin (for external sensors) + +Sonoff LED +---------- + +.. pintable:: + + GPIO0, Button (inverted), + GPIO13, Blue LED (inverted), + GPIO5, Red Channel + GPIO4, Green Channel + GPIO15, Blue Channel + GPIO12, Cold White Channel + GPIO14, Warm White Channel + +See :doc:`/esphomeyaml/components/light/rgbww` for controlling the lights together with +:doc:`/esphomeyaml/components/output/esp8266_pwm`. + +ElectroDragon +------------- + +.. pintable:: + + GPIO2, Button 1 (inverted), + GPIO0, Button 2 (inverted), + GPIO13, Relay 1 and Red LED, + GPIO12, Relay 2 and Red LED, + GPIO16, Green/Blue LED + GPIO17, Analog Input + + +Sonoff SC +--------- + +.. pintable:: + + GPIO12, Light, + GPIO13, Red LED (inverted) + +See :doc:`/esphomeyaml/components/light/monochromatic` and :doc:`/esphomeyaml/components/output/esp8266_pwm` +for controlling the light pin. + +Sonoff 4CH Pro +-------------- + +Same configuration as the :doc:`Sonoff 4CH `. + + +Sonoff B1, Ai-Thinker AiLight +----------------------------- + +See :doc:`/esphomeyaml/components/my9231`. + +Sonoff T1 1CH, 2CH, 3CH +----------------------- + +.. pintable:: + + GPIO0, Button 1 (inverted), + GPIO12, Relay 1 and Blue LED, + GPIO9, Button 2 (inverted), + GPIO5, Relay 2 and Blue LED, + GPIO10, Button 3 (inverted), + GPIO4, Relay 3 and Blue LED, + GPIO1, UART RX pin (for external sensors) + GPIO3, UART TX pin (for external sensors) + +Arilux LC10, Magic Home +----------------------- + +.. pintable:: + + GPIO2, Blue LED, + GPIO14, Red Channel, + GPIO5, Green Channel, + GPIO12, Blue Channel, + GPIO13, White Channel, + + GPIO1, UART RX pin (for external sensors) + GPIO3, UART TX pin (for external sensors) + +See :doc:`/esphomeyaml/components/light/rgbw` for controlling the lights together with +:doc:`/esphomeyaml/components/output/esp8266_pwm`. + +Arilux LC01 +----------- + +.. pintable:: + + GPIO0, Button (inverted), + GPIO2, Blue LED, + GPIO5, Red Channel, + GPIO12, Green Channel, + GPIO13, Blue Channel, + GPIO14, White Channel, + + GPIO1, UART RX pin (for external sensors) + GPIO3, UART TX pin (for external sensors) + +See :doc:`/esphomeyaml/components/light/rgbw` for controlling the lights together with +:doc:`/esphomeyaml/components/output/esp8266_pwm`. + +Arilux LC11 +----------- + +.. pintable:: + + GPIO0, Button (inverted), + GPIO2, Blue LED, + GPIO5, Red Channel, + GPIO4, Green Channel, + GPIO14, Blue Channel, + GPIO13, Cold White Channel, + GPIO12, Warm White Channel, + + GPIO1, UART RX pin (for external sensors) + GPIO3, UART TX pin (for external sensors) + +See :doc:`/esphomeyaml/components/light/rgbww` for controlling the lights together with +:doc:`/esphomeyaml/components/output/esp8266_pwm`. Sonoff S31 ---------- -.. table:: - :class: no-center +.. pintable:: - ================================================== ================================================== - ``GPIO0`` Button (inverted) - -------------------------------------------------- -------------------------------------------------- - ``GPIO1`` ``RX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO3`` ``TX`` pin (for external sensors) - -------------------------------------------------- -------------------------------------------------- - ``GPIO5`` Relay #2 - -------------------------------------------------- -------------------------------------------------- - ``GPIO12`` Relay and red LED - -------------------------------------------------- -------------------------------------------------- - ``GPIO13`` Green LED (inverted) - ================================================== ================================================== + GPIO0, Button (inverted), + GPIO12, Relay and Red LED, + GPIO13, Green LED (inverteD), + +See :doc:`/esphomeyaml/components/sensor/cse7766` for measuring power + +Shelly 1 +-------- + +.. pintable:: + + GPIO4, Relay, + GPIO5, SW Input, See Also -------- diff --git a/github.py b/github.py index 181783a57..877c74b84 100644 --- a/github.py +++ b/github.py @@ -134,9 +134,76 @@ class ImageTableDirective(Table): return [table] + messages +class PinTableDirective(Table): + option_spec = {} + + def run(self): + env = self.state.document.settings.env + + items = [] + + data = list(csv.reader(self.content)) + for row in data: + if not row: + continue + if len(row) == 3: + items.append((row[0], row[1], True)) + else: + items.append((row[0], row[1], False)) + + col_widths = self.get_column_widths(2) + title, messages = self.make_title() + table = nodes.table() + + # Set up column specifications based on widths + tgroup = nodes.tgroup(cols=2) + table += tgroup + tgroup.extend( + nodes.colspec(colwidth=col_width) + for col_width in col_widths + ) + + thead = nodes.thead() + tgroup += thead + trow = nodes.row() + thead += trow + trow.extend( + nodes.entry(h, nodes.paragraph(text=h)) + for h in ('Pin', 'Function') + ) + + tbody = nodes.tbody() + tgroup += tbody + for name, func, important in items: + trow = nodes.row() + entry = nodes.entry() + para = nodes.paragraph() + para += nodes.literal(text=name) + entry += para + trow += entry + + entry = nodes.entry() + if important: + para = nodes.paragraph() + para += nodes.strong(text=func) + else: + para = nodes.paragraph(text=func) + entry += para + trow += entry + tbody += trow + + table['classes'] += ['no-center'] + self.add_name(table) + if title: + table.insert(0, title) + + return [table] + messages + + def setup(app): app.add_role('libpr', libpr_role) app.add_role('yamlpr', yamlpr_role) app.add_role('docspr', docspr_role) app.add_role('ghuser', ghuser_role) app.add_directive('imgtable', ImageTableDirective) + app.add_directive('pintable', PinTableDirective) From d31f08a12088e813f3c4219ca3721e7ae1bdc4e2 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sat, 17 Nov 2018 10:07:22 +0100 Subject: [PATCH 10/35] Fix RX/TX pins switched. Fixes #84 --- esphomeyaml/components/sensor/index.rst | 2 +- esphomeyaml/devices/sonoff.rst | 36 ++++++++++++------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/esphomeyaml/components/sensor/index.rst b/esphomeyaml/components/sensor/index.rst index 9baac52ce..90b4654dc 100644 --- a/esphomeyaml/components/sensor/index.rst +++ b/esphomeyaml/components/sensor/index.rst @@ -86,7 +86,7 @@ sensor values before they’re sent to Home Assistant. This is for example useful if you want to apply some average over the last few values to relief Home Assistant’s state machine and keep the history graphs in the front-end a bit more clean. More sophisticated filters should be done -with Home Assistant `filter +with Home Assistant's `filter sensor `__. .. code:: yaml diff --git a/esphomeyaml/devices/sonoff.rst b/esphomeyaml/devices/sonoff.rst index 1796906b2..2a430efa5 100644 --- a/esphomeyaml/devices/sonoff.rst +++ b/esphomeyaml/devices/sonoff.rst @@ -33,8 +33,8 @@ Sonoff RF GPIO0, Button (inverted), GPIO12, Relay and Red LED, GPIO13, Green LED (inverted), - GPIO1, UART RX pin (for external sensors) - GPIO3, UART TX pin (for external sensors) + GPIO1, UART TX pin (for external sensors) + GPIO3, UART RX pin (for external sensors) GPIO4, Optional sensor GPIO14, Optional sensor @@ -48,8 +48,8 @@ Sonoff SV GPIO12, Relay and Red LED, GPIO13, Green LED (inverted), GPIO17, Analog Input, - GPIO1, UART RX pin (for external sensors) - GPIO3, UART TX pin (for external sensors) + GPIO1, UART TX pin (for external sensors) + GPIO3, UART RX pin (for external sensors) GPIO4, Optional sensor GPIO5, Optional sensor GPIO14, Optional sensor @@ -63,8 +63,8 @@ Sonoff TH10/TH16 GPIO0, Button (inverted), GPIO12, Relay and Red LED, GPIO13, Green LED (inverted), - GPIO1, UART RX pin (for external sensors) - GPIO3, UART TX pin (for external sensors) + GPIO1, UART TX pin (for external sensors) + GPIO3, UART RX pin (for external sensors) GPIO4, Optional sensor GPIO14, Optional sensor @@ -134,8 +134,8 @@ Slampher GPIO0, Button (inverted), GPIO3, Relay and Red LED, GPIO13, Blue LED (inverted), - GPIO1, UART RX pin (for external sensors) - GPIO3, UART TX pin (for external sensors) + GPIO1, UART TX pin (for external sensors) + GPIO3, UART RX pin (for external sensors) Sonoff Touch ------------ @@ -145,8 +145,8 @@ Sonoff Touch GPIO0, Button (inverted), GPIO12, Relay and Red LED, GPIO13, Blue LED (inverted), - GPIO1, UART RX pin (for external sensors) - GPIO3, UART TX pin (for external sensors) + GPIO1, UART TX pin (for external sensors) + GPIO3, UART RX pin (for external sensors) Sonoff LED ---------- @@ -210,8 +210,8 @@ Sonoff T1 1CH, 2CH, 3CH GPIO5, Relay 2 and Blue LED, GPIO10, Button 3 (inverted), GPIO4, Relay 3 and Blue LED, - GPIO1, UART RX pin (for external sensors) - GPIO3, UART TX pin (for external sensors) + GPIO1, UART TX pin (for external sensors) + GPIO3, UART RX pin (for external sensors) Arilux LC10, Magic Home ----------------------- @@ -224,8 +224,8 @@ Arilux LC10, Magic Home GPIO12, Blue Channel, GPIO13, White Channel, - GPIO1, UART RX pin (for external sensors) - GPIO3, UART TX pin (for external sensors) + GPIO1, UART TX pin (for external sensors) + GPIO3, UART RX pin (for external sensors) See :doc:`/esphomeyaml/components/light/rgbw` for controlling the lights together with :doc:`/esphomeyaml/components/output/esp8266_pwm`. @@ -242,8 +242,8 @@ Arilux LC01 GPIO13, Blue Channel, GPIO14, White Channel, - GPIO1, UART RX pin (for external sensors) - GPIO3, UART TX pin (for external sensors) + GPIO1, UART TX pin (for external sensors) + GPIO3, UART RX pin (for external sensors) See :doc:`/esphomeyaml/components/light/rgbw` for controlling the lights together with :doc:`/esphomeyaml/components/output/esp8266_pwm`. @@ -261,8 +261,8 @@ Arilux LC11 GPIO13, Cold White Channel, GPIO12, Warm White Channel, - GPIO1, UART RX pin (for external sensors) - GPIO3, UART TX pin (for external sensors) + GPIO1, UART TX pin (for external sensors) + GPIO3, UART RX pin (for external sensors) See :doc:`/esphomeyaml/components/light/rgbww` for controlling the lights together with :doc:`/esphomeyaml/components/output/esp8266_pwm`. From b5ffffe955499729bdbdd430454115ef30a3650a Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 19 Nov 2018 18:32:16 +0100 Subject: [PATCH 11/35] Fix broken links, SEO svg2png, and fix code highlighting --- .gitlab-ci.yml | 15 +---- Dockerfile | 6 ++ Makefile | 7 ++- conf.py | 7 ++- esphomeyaml/changelog/index.rst | 2 +- esphomeyaml/changelog/v1.7.0.rst | 4 +- esphomeyaml/changelog/v1.8.0.rst | 6 +- esphomeyaml/components/ads1115.rst | 2 +- .../binary_sensor/esp32_ble_tracker.rst | 6 +- .../components/binary_sensor/esp32_touch.rst | 6 +- esphomeyaml/components/binary_sensor/gpio.rst | 12 ++-- .../components/binary_sensor/index.rst | 22 ++++---- .../components/binary_sensor/nextion.rst | 2 +- .../components/binary_sensor/pn532.rst | 2 +- .../components/binary_sensor/rdm6300.rst | 2 +- .../binary_sensor/remote_receiver.rst | 6 +- .../components/binary_sensor/status.rst | 4 +- .../components/binary_sensor/template.rst | 4 +- esphomeyaml/components/cover/index.rst | 18 +++--- esphomeyaml/components/cover/template.rst | 4 +- esphomeyaml/components/dallas.rst | 2 +- esphomeyaml/components/debug.rst | 4 +- esphomeyaml/components/deep_sleep.rst | 12 ++-- esphomeyaml/components/display/index.rst | 28 +++++----- esphomeyaml/components/display/lcd_gpio.rst | 4 +- .../components/display/lcd_pcf8574.rst | 2 +- esphomeyaml/components/display/max7219.rst | 4 +- esphomeyaml/components/display/nextion.rst | 6 +- .../components/display/ssd1306_i2c.rst | 4 +- .../components/display/ssd1306_spi.rst | 4 +- .../components/display/waveshare_epaper.rst | 2 +- esphomeyaml/components/esp32_ble_beacon.rst | 4 +- esphomeyaml/components/esp32_ble_tracker.rst | 4 +- esphomeyaml/components/esp32_touch.rst | 10 ++-- esphomeyaml/components/esphomeyaml.rst | 18 +++--- esphomeyaml/components/fan/binary.rst | 4 +- esphomeyaml/components/fan/index.rst | 10 ++-- esphomeyaml/components/fan/speed.rst | 4 +- esphomeyaml/components/i2c.rst | 4 +- esphomeyaml/components/light/binary.rst | 4 +- esphomeyaml/components/light/cwww.rst | 4 +- .../components/light/fastled_clockless.rst | 4 +- esphomeyaml/components/light/fastled_spi.rst | 4 +- esphomeyaml/components/light/index.rst | 38 ++++++------- .../components/light/monochromatic.rst | 4 +- esphomeyaml/components/light/rgb.rst | 2 +- esphomeyaml/components/light/rgbw.rst | 2 +- esphomeyaml/components/light/rgbww.rst | 2 +- esphomeyaml/components/logger.rst | 8 +-- esphomeyaml/components/mqtt.rst | 41 +++++++------- esphomeyaml/components/my9231.rst | 6 +- esphomeyaml/components/ota.rst | 4 +- esphomeyaml/components/output/esp8266_pwm.rst | 2 +- esphomeyaml/components/output/gpio.rst | 4 +- esphomeyaml/components/output/index.rst | 16 +++--- esphomeyaml/components/output/ledc.rst | 8 +-- esphomeyaml/components/output/my9231.rst | 4 +- esphomeyaml/components/output/pca9685.rst | 2 +- esphomeyaml/components/pca9685.rst | 4 +- esphomeyaml/components/pcf8574.rst | 2 +- esphomeyaml/components/pn532.rst | 4 +- esphomeyaml/components/power_supply.rst | 6 +- esphomeyaml/components/rdm6300.rst | 2 +- esphomeyaml/components/remote_receiver.rst | 4 +- esphomeyaml/components/remote_transmitter.rst | 4 +- esphomeyaml/components/sensor/adc.rst | 8 +-- esphomeyaml/components/sensor/ads1115.rst | 2 +- esphomeyaml/components/sensor/bh1750.rst | 2 +- esphomeyaml/components/sensor/ble_rssi.rst | 4 +- esphomeyaml/components/sensor/bme280.rst | 2 +- esphomeyaml/components/sensor/bme680.rst | 2 +- esphomeyaml/components/sensor/bmp085.rst | 2 +- esphomeyaml/components/sensor/bmp280.rst | 2 +- esphomeyaml/components/sensor/cse7766.rst | 4 +- esphomeyaml/components/sensor/custom.rst | 33 ++++++----- esphomeyaml/components/sensor/dallas.rst | 6 +- esphomeyaml/components/sensor/dht.rst | 2 +- esphomeyaml/components/sensor/dht12.rst | 2 +- esphomeyaml/components/sensor/duty_cycle.rst | 4 +- esphomeyaml/components/sensor/esp32_hall.rst | 4 +- esphomeyaml/components/sensor/hdc1080.rst | 2 +- esphomeyaml/components/sensor/hlw8012.rst | 4 +- esphomeyaml/components/sensor/hmc5883l.rst | 2 +- esphomeyaml/components/sensor/htu21d.rst | 4 +- esphomeyaml/components/sensor/hx711.rst | 6 +- esphomeyaml/components/sensor/ina219.rst | 2 +- esphomeyaml/components/sensor/ina3221.rst | 2 +- esphomeyaml/components/sensor/index.rst | 24 ++++---- esphomeyaml/components/sensor/max6675.rst | 2 +- esphomeyaml/components/sensor/mhz19.rst | 2 +- esphomeyaml/components/sensor/mpu6050.rst | 2 +- .../components/sensor/mqtt_subscribe.rst | 2 +- esphomeyaml/components/sensor/ms5611.rst | 4 +- esphomeyaml/components/sensor/pmsx003.rst | 4 +- .../components/sensor/pulse_counter.rst | 10 ++-- .../components/sensor/rotary_encoder.rst | 4 +- esphomeyaml/components/sensor/sht3xd.rst | 2 +- esphomeyaml/components/sensor/tcs34725.rst | 2 +- esphomeyaml/components/sensor/template.rst | 6 +- .../components/sensor/total_daily_energy.rst | 4 +- esphomeyaml/components/sensor/tsl2561.rst | 4 +- esphomeyaml/components/sensor/ultrasonic.rst | 4 +- esphomeyaml/components/sensor/uptime.rst | 4 +- esphomeyaml/components/sensor/wifi_signal.rst | 4 +- .../components/sensor/xiaomi_miflora.rst | 4 +- .../components/sensor/xiaomi_mijia.rst | 4 +- esphomeyaml/components/spi.rst | 4 +- esphomeyaml/components/status_led.rst | 6 +- esphomeyaml/components/stepper/index.rst | 14 ++--- esphomeyaml/components/switch/gpio.rst | 4 +- esphomeyaml/components/switch/index.rst | 16 +++--- esphomeyaml/components/switch/output.rst | 4 +- .../components/switch/remote_transmitter.rst | 22 ++++---- esphomeyaml/components/switch/restart.rst | 4 +- esphomeyaml/components/switch/shutdown.rst | 4 +- esphomeyaml/components/switch/template.rst | 4 +- esphomeyaml/components/switch/uart.rst | 4 +- esphomeyaml/components/text_sensor/index.rst | 10 ++-- .../components/text_sensor/mqtt_subscribe.rst | 4 +- .../components/text_sensor/template.rst | 4 +- .../components/text_sensor/version.rst | 4 +- esphomeyaml/components/time.rst | 32 +++++------ esphomeyaml/components/uart.rst | 4 +- esphomeyaml/components/web_server.rst | 4 +- esphomeyaml/components/wifi.rst | 8 +-- esphomeyaml/cookbook/bruh.rst | 2 +- esphomeyaml/cookbook/dual-r2-cover.rst | 2 +- esphomeyaml/cookbook/garage-door.rst | 4 +- esphomeyaml/cookbook/pir.rst | 2 +- esphomeyaml/cookbook/power_meter.rst | 4 +- esphomeyaml/cookbook/relay.rst | 2 +- esphomeyaml/cookbook/temt6000.rst | 2 +- esphomeyaml/devices/esp32.rst | 6 +- esphomeyaml/devices/esp8266.rst | 6 +- esphomeyaml/devices/nodemcu_esp32.rst | 4 +- esphomeyaml/devices/nodemcu_esp8266.rst | 4 +- esphomeyaml/devices/sonoff.rst | 4 +- esphomeyaml/devices/sonoff_4ch.rst | 6 +- esphomeyaml/devices/sonoff_basic.rst | 4 +- esphomeyaml/devices/sonoff_s20.rst | 8 +-- esphomeyaml/guides/automations.rst | 42 +++++++------- esphomeyaml/guides/cli.rst | 2 +- esphomeyaml/guides/configuration-types.rst | 10 ++-- esphomeyaml/guides/contributing.rst | 55 +++++++++---------- esphomeyaml/guides/faq.rst | 27 +++++---- .../guides/getting_started_command_line.rst | 23 ++++---- esphomeyaml/guides/getting_started_hassio.rst | 9 ++- esphomeyaml/guides/migrate_espeasy.rst | 2 +- esphomeyaml/guides/migrate_espurna.rst | 2 +- esphomeyaml/guides/migrate_sonoff_tasmota.rst | 2 +- esphomeyaml/index.rst | 4 +- githubpages.py | 14 +++++ index.rst | 8 +-- seo.py | 4 -- svg2png.py | 31 +++++++++++ web-api/index.rst | 2 +- 156 files changed, 569 insertions(+), 529 deletions(-) create mode 100644 githubpages.py create mode 100644 svg2png.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f57d37c2..8b1332c41 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,14 +1,4 @@ --- -build: - tags: - - esphomedocs - script: - - make ../esphomelib - - make html - except: - - current - - rc - .deploy: &deploy tags: - esphomedocs @@ -26,12 +16,13 @@ build: - git fetch --force git@github.com:${TARGET_REPO}.git gh-pages:gh-pages - git worktree add _build/html gh-pages - make ../esphomelib - - touch _build/html/.nojekyll - - echo ${CNAME} >_build/html/CNAME - make html - git -C _build/html add --all - git -C _build/html commit -m "Deploy to gh-pages" - git -C _build/html push -f git@github.com:${TARGET_REPO}.git gh-pages + cache: + paths: + - _build/doctrees deploy-release: <<: *deploy diff --git a/Dockerfile b/Dockerfile index 31c49ca72..dd97e3c54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ make \ doxygen \ openssh-client \ + software-properties-common \ + && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* + +RUN apt-add-repository ppa:inkscape.dev/stable && \ + apt-get update && apt-get install -y --no-install-recommends \ + inkscape \ && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* RUN pip3 install --no-cache-dir --no-binary :all: \ diff --git a/Makefile b/Makefile index 8e828d870..38777a2e6 100644 --- a/Makefile +++ b/Makefile @@ -32,9 +32,10 @@ $(ESPHOMELIB_PATH): git clone --branch $(ESPHOMELIB_TAG) https://github.com/OttoWinter/esphomelib.git $(ESPHOMELIB_PATH); \ fi -deploy: cleanhtml doxyg html $(ESPHOMELIB_PATH) - touch "$(BUILDDIR)/html/.nojekyll" - echo "$(CNAME)" >"$(BUILDDIR)/html/CNAME" +convertimages: + python3 svg2png.py + +deploy: cleanhtml doxyg html $(ESPHOMELIB_PATH) convertimages git -C "$(BUILDDIR)/html" add --all && git -C "$(BUILDDIR)/html" commit -m "Deploy to gh-pages" @printf "Run \033[0;36mcd $(BUILDDIR)/html && git push origin gh-pages\033[0m to deploy\n" diff --git a/conf.py b/conf.py index 6da0f8ba4..db615ec94 100644 --- a/conf.py +++ b/conf.py @@ -45,6 +45,7 @@ extensions = [ 'disqus', 'github', 'seo', + 'githubpages', 'sitemap', ] @@ -67,6 +68,7 @@ master_doc = 'index' # General information about the project. project = 'esphomelib' copyright = '2018, Otto Winter' +html_show_copyright = False author = 'Otto Winter' # The version info for the project you're documenting, acts as replacement for @@ -94,9 +96,9 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # default_role = 'cpp:any' # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = 'xcode' -# highlight_language = 'yaml' +highlight_language = 'yaml' primary_domain = None @@ -210,3 +212,4 @@ texinfo_documents = [ 'Miscellaneous'), ] html_baseurl = os.getenv('BASE_URL', 'https://esphomelib.com') +linkcheck_ignore = [r'https://github.com/.*', r'https://discord.gg/.*'] diff --git a/esphomeyaml/changelog/index.rst b/esphomeyaml/changelog/index.rst index 46f7c87b6..38405d810 100644 --- a/esphomeyaml/changelog/index.rst +++ b/esphomeyaml/changelog/index.rst @@ -94,7 +94,7 @@ New Features - The current esphomelib version and compilation time are now printed on each boot (:libpr:`189`, :yamlpr:`159`): - .. code:: bash + .. code-block:: text [13:57:33][I][application:092]: You're running esphomelib v1.9.0 compiled on Nov 3 2018, 13:55:11 diff --git a/esphomeyaml/changelog/v1.7.0.rst b/esphomeyaml/changelog/v1.7.0.rst index bce2cb389..6ff77023c 100644 --- a/esphomeyaml/changelog/v1.7.0.rst +++ b/esphomeyaml/changelog/v1.7.0.rst @@ -94,7 +94,7 @@ Breaking Changes parameter. The accuracy now defaults to ``HIGH``. - The ``inverted`` option of binary sensors has been moved into the ``filters:`` section. So instead of - .. code:: yaml + .. code-block:: yaml binary_sensor: - platform: ... @@ -103,7 +103,7 @@ Breaking Changes you would now write: - .. code:: yaml + .. code-block:: yaml binary_sensor: - platform: ... diff --git a/esphomeyaml/changelog/v1.8.0.rst b/esphomeyaml/changelog/v1.8.0.rst index fd92f02bb..dc12697d2 100644 --- a/esphomeyaml/changelog/v1.8.0.rst +++ b/esphomeyaml/changelog/v1.8.0.rst @@ -121,7 +121,7 @@ Other notable changes - In actions, instead of - .. code:: yaml + .. code-block:: yaml on_...: then: @@ -130,7 +130,7 @@ Other notable changes You can now write: - .. code:: yaml + .. code-block:: yaml on_...: then: @@ -138,7 +138,7 @@ Other notable changes Or even shorter: - .. code:: yaml + .. code-block:: yaml on_...: - switch.turn_on: my_switch diff --git a/esphomeyaml/components/ads1115.rst b/esphomeyaml/components/ads1115.rst index b1de82cd2..f825f28d8 100644 --- a/esphomeyaml/components/ads1115.rst +++ b/esphomeyaml/components/ads1115.rst @@ -19,7 +19,7 @@ To use this hub, first setup the :ref:`I²C Bus ` and connect the sensor to .. _Adafruit: https://www.adafruit.com/product/1085 -.. code:: yaml +.. code-block:: yaml ads1115: - address: 0x48 diff --git a/esphomeyaml/components/binary_sensor/esp32_ble_tracker.rst b/esphomeyaml/components/binary_sensor/esp32_ble_tracker.rst index 069513dbd..62a16f493 100644 --- a/esphomeyaml/components/binary_sensor/esp32_ble_tracker.rst +++ b/esphomeyaml/components/binary_sensor/esp32_ble_tracker.rst @@ -3,7 +3,7 @@ ESP32 Bluetooth Low Energy Device .. seo:: :description: Instructions for setting up BLE binary sensors for the ESP32. - :image: bluetooth.svg + :image: bluetooth.png The ``esp32_ble_tracker`` binary sensor platform lets you track the presence of a bluetooth low energy device. @@ -12,7 +12,7 @@ bluetooth low energy device. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry esp32_ble_tracker: @@ -44,7 +44,7 @@ to track. Most devices show this screen in some setting menu. If you don't know however, you can use the ``esp32_ble_tracker`` hub without any binary sensors attached and read through the logs to see discovered Bluetooth Low Energy devices. -.. code:: yaml +.. code-block:: yaml # Example configuration entry for finding MAC addresses esp32_ble_tracker: diff --git a/esphomeyaml/components/binary_sensor/esp32_touch.rst b/esphomeyaml/components/binary_sensor/esp32_touch.rst index 6087ebe90..d39d1dff7 100644 --- a/esphomeyaml/components/binary_sensor/esp32_touch.rst +++ b/esphomeyaml/components/binary_sensor/esp32_touch.rst @@ -3,7 +3,7 @@ ESP32 Touch Pad Binary Sensor .. seo:: :description: Instructions for setting up the touch pad on the ESP32. - :image: touch.svg + :image: touch.png The ``esp32_touch`` binary sensor platform lets you use the touch peripheral of the ESP32 to detect if a certain pin is being "touched". @@ -17,7 +17,7 @@ an ``OFF`` state. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry esp32_touch: @@ -72,7 +72,7 @@ to output measured values using the ``setup_mode:`` configuration option. Next, for the touch pads you want to observe. Also put some threshold in the configuration as seen below to make the validator happy, we are going to find good thresholds in a moment anyway. -.. code:: yaml +.. code-block:: yaml # Example configuration entry for finding threshold values esp32_touch: diff --git a/esphomeyaml/components/binary_sensor/gpio.rst b/esphomeyaml/components/binary_sensor/gpio.rst index adcc83a45..577dd233d 100644 --- a/esphomeyaml/components/binary_sensor/gpio.rst +++ b/esphomeyaml/components/binary_sensor/gpio.rst @@ -3,7 +3,7 @@ GPIO Binary Sensor .. seo:: :description: Instructions for setting up GPIO binary sensors with esphomelib. - :image: pin.svg + :image: pin.png The GPIO Binary Sensor platform allows you to use any input pin on your device as a binary sensor. @@ -12,7 +12,7 @@ device as a binary sensor. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry binary_sensor: @@ -35,7 +35,7 @@ Configuration variables: For some applications such as reed switches you need to set the pin mode to ``INPUT_PULLUP`` like this: - .. code:: yaml + .. code-block:: yaml binary_sensor: - platform: gpio @@ -50,7 +50,7 @@ Inverting Values Use the ``inverted`` property of the :ref:`Pin Schema ` to invert the binary sensor: -.. code:: yaml +.. code-block:: yaml # Example configuration entry binary_sensor: @@ -66,7 +66,7 @@ Debouncing Values Some binary sensors are a bit unstable and quickly transition between the ON and OFF state while they're pressed. To fix this and debounce the signal, use the :ref:`binary sensor filters `: -.. code:: yaml +.. code-block:: yaml # Example configuration entry binary_sensor: @@ -80,7 +80,7 @@ Above example will only make the signal go high if the button has stayed high fo Alternatively, below configuration will make the binary sensor publish an ON value immediately, but will wait 10ms before publishing an OFF value: -.. code:: yaml +.. code-block:: yaml # Example configuration entry binary_sensor: diff --git a/esphomeyaml/components/binary_sensor/index.rst b/esphomeyaml/components/binary_sensor/index.rst index 7c01f77d9..114bb25cc 100644 --- a/esphomeyaml/components/binary_sensor/index.rst +++ b/esphomeyaml/components/binary_sensor/index.rst @@ -3,7 +3,7 @@ Binary Sensor Component .. seo:: :description: Information about the base representation of all binary sensors. - :image: folder-open.svg + :image: folder-open.png With esphomelib you can use different types of binary sensors. They will automatically appear in the Home Assistant front-end and have several @@ -19,7 +19,7 @@ All binary sensors have a platform and an optional device class. By default, the binary will chose the appropriate device class itself, but you can always override it. -.. code:: yaml +.. code-block:: yaml binary_sensor: - platform: ... @@ -58,7 +58,7 @@ Binary Sensor Filters With binary sensor filters you can customize how esphomelib handles your binary sensor values even more. They are similar to :ref:`Sensor Filters `. -.. code:: yaml +.. code-block:: yaml binary_sensor: - platform: ... @@ -110,7 +110,7 @@ You can access the current state of the binary sensor in :ref:`lambdas `. This automation will be triggered when a button press ends, or in other words on the falling edge of the signal. -.. code:: yaml +.. code-block:: yaml binary_sensor: - platform: gpio @@ -149,7 +149,7 @@ This automation will be triggered when a button is pressed down for a time perio ``min_length`` to ``max_length``. Any click longer or shorter than this will not trigger the automation. The automation is therefore also triggered on the falling edge of the signal. -.. code:: yaml +.. code-block:: yaml binary_sensor: - platform: gpio @@ -175,7 +175,7 @@ This automation will be triggered when a button is pressed down twice, with the ``min_length`` and ``max_length``. When a second leading edge then happens within ``min_length`` and ``max_length``, the automation is triggered. -.. code:: yaml +.. code-block:: yaml binary_sensor: - platform: gpio @@ -200,7 +200,7 @@ Configuration variables: This automation will be triggered when a button is pressed in a user-specified sequence. -.. code:: yaml +.. code-block:: yaml binary_sensor: - platform: gpio @@ -238,7 +238,7 @@ You can use an ``OFF`` timing at the end of the timing sequence to differentiate kinds of presses. For example the configuration below will differentiate between double, long and short presses. -.. code:: yaml +.. code-block:: yaml on_multi_click: - timing: @@ -269,7 +269,7 @@ advanced stuff (see the full :doc:`API Reference ` for - ``publish_state()``: Manually cause the binary sensor to publish and store a state from anywhere in the program. - .. code:: yaml + .. code-block:: yaml // Within lambda, publish an OFF state. id(my_binary_sensor).publish_state(false); @@ -279,7 +279,7 @@ advanced stuff (see the full :doc:`API Reference ` for - ``.state``: Retrieve the current state of the binary sensor. - .. code:: yaml + .. code-block:: yaml // Within lambda, get the binary sensor state and conditionally do something if (id(my_binary_sensor).state) { diff --git a/esphomeyaml/components/binary_sensor/nextion.rst b/esphomeyaml/components/binary_sensor/nextion.rst index ccc6b9c98..e8195be52 100644 --- a/esphomeyaml/components/binary_sensor/nextion.rst +++ b/esphomeyaml/components/binary_sensor/nextion.rst @@ -11,7 +11,7 @@ pressed on, and will turn off as soon as the finger is released. See :doc:`/esphomeyaml/components/display/nextion` for setting up the display -.. code:: yaml +.. code-block:: yaml # Example configuration entry display: diff --git a/esphomeyaml/components/binary_sensor/pn532.rst b/esphomeyaml/components/binary_sensor/pn532.rst index 21b03d215..e76735f97 100644 --- a/esphomeyaml/components/binary_sensor/pn532.rst +++ b/esphomeyaml/components/binary_sensor/pn532.rst @@ -14,7 +14,7 @@ unique id (``uid``) is currently being detected by the PN532 or not. See :doc:`/esphomeyaml/components/pn532` for instructions for setting up the connection to the PN532. -.. code:: yaml +.. code-block:: yaml # Example configuration entry spi: diff --git a/esphomeyaml/components/binary_sensor/rdm6300.rst b/esphomeyaml/components/binary_sensor/rdm6300.rst index 4fc4b169e..4349cec09 100644 --- a/esphomeyaml/components/binary_sensor/rdm6300.rst +++ b/esphomeyaml/components/binary_sensor/rdm6300.rst @@ -14,7 +14,7 @@ unique id (``uid``) is currently being detected by the RDM6300 or not. See :doc:`/esphomeyaml/components/rdm6300` for instructions for setting up the connection to the RDM6300. -.. code:: yaml +.. code-block:: yaml # Example configuration entry uart: diff --git a/esphomeyaml/components/binary_sensor/remote_receiver.rst b/esphomeyaml/components/binary_sensor/remote_receiver.rst index 882ac5158..1c30c4eba 100644 --- a/esphomeyaml/components/binary_sensor/remote_receiver.rst +++ b/esphomeyaml/components/binary_sensor/remote_receiver.rst @@ -3,14 +3,14 @@ Remote Receiver Binary Sensor .. seo:: :description: Instructions for setting up remote receiver binary sensors for infrared and RF codes. - :image: remote.svg + :image: remote.png The ``remote_receiver`` binary sensor lets you track when a button on a remote control is pressed. Each time the pre-defined signal is received, the binary sensor will briefly go ON and then immediately OFF. -.. code:: yaml +.. code-block:: yaml # Example configuration entry remote_receiver: @@ -45,7 +45,7 @@ Configuration variables: For the Sonoff RF Bridge you can use `this hack `__ created by the Github user wildwiz. Then use this configuration for the remote receiver/transmitter hubs: - .. code:: yaml + .. code-block:: yaml remote_receiver: pin: 4 diff --git a/esphomeyaml/components/binary_sensor/status.rst b/esphomeyaml/components/binary_sensor/status.rst index 27624520f..25f7ebabf 100644 --- a/esphomeyaml/components/binary_sensor/status.rst +++ b/esphomeyaml/components/binary_sensor/status.rst @@ -3,7 +3,7 @@ Status Binary Sensor .. seo:: :description: Instructions for setting up MQTT status binary sensors. - :image: server-network.svg + :image: server-network.png The Status Binary Sensor exposes the node state (if it’s connected to MQTT or not) for Home Assistant. It uses the :ref:`MQTT birth and last will messages ` @@ -13,7 +13,7 @@ to do this. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry binary_sensor: diff --git a/esphomeyaml/components/binary_sensor/template.rst b/esphomeyaml/components/binary_sensor/template.rst index 1094d086b..a58e8f36b 100644 --- a/esphomeyaml/components/binary_sensor/template.rst +++ b/esphomeyaml/components/binary_sensor/template.rst @@ -3,7 +3,7 @@ Template Binary Sensor .. seo:: :description: Instructions for setting up template binary sensors. - :image: description.svg + :image: description.png The ``template`` binary sensor platform allows you to define any :ref:`lambda template ` and construct a binary sensor out if it. @@ -11,7 +11,7 @@ and construct a binary sensor out if it. For example, below configuration would turn the state of an ultrasonic sensor into a binary sensor. -.. code:: yaml +.. code-block:: yaml # Example configuration entry binary_sensor: diff --git a/esphomeyaml/components/cover/index.rst b/esphomeyaml/components/cover/index.rst index 5e640d38c..0fb9f10dd 100644 --- a/esphomeyaml/components/cover/index.rst +++ b/esphomeyaml/components/cover/index.rst @@ -3,7 +3,7 @@ Cover Component .. seo:: :description: Instructions for setting up base covers in esphomelib. - :image: folder-opn.svg + :image: folder-opn.png The ``cover`` component is a generic representation of covers in esphomelib/yaml. A cover can (currently) either be *closed* or *open* and supports three types of @@ -16,7 +16,7 @@ commands: *open*, *close* and *stop*. This action opens the cover with the given ID when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -26,7 +26,7 @@ This action opens the cover with the given ID when executed. This action can also be expressed in :ref:`lambdas `: - .. code:: cpp + .. code-block:: cpp id(cover_1).open(); @@ -37,7 +37,7 @@ This action opens the cover with the given ID when executed. This action closes the cover with the given ID when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -47,7 +47,7 @@ This action closes the cover with the given ID when executed. This action can also be expressed in :ref:`lambdas `: - .. code:: cpp + .. code-block:: cpp id(cover_1).close(); @@ -58,7 +58,7 @@ This action closes the cover with the given ID when executed. This action stops the cover with the given ID when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -68,7 +68,7 @@ This action stops the cover with the given ID when executed. This action can also be expressed in :ref:`lambdas `: - .. code:: cpp + .. code-block:: cpp id(cover_1).stop(); @@ -82,7 +82,7 @@ advanced stuff (see the full :doc:`API Reference ` for more in - ``publish_state()``: Manually cause the cover to publish a new state and store it internally. If it's different from the last internal state, it's additionally published to the frontend. - .. code:: yaml + .. code-block:: yaml // Within lambda, make the cover report a specific state id(my_cover).publish_state(cover::COVER_OPEN); @@ -90,7 +90,7 @@ advanced stuff (see the full :doc:`API Reference ` for more in - ``state``: Retrieve the current state of the cover. - .. code:: yaml + .. code-block:: yaml if (id(my_cover).state == cover::COVER_OPEN) { // Cover is open diff --git a/esphomeyaml/components/cover/template.rst b/esphomeyaml/components/cover/template.rst index 0f0b4972b..061d36fbd 100644 --- a/esphomeyaml/components/cover/template.rst +++ b/esphomeyaml/components/cover/template.rst @@ -3,7 +3,7 @@ Template Cover .. seo:: :description: Instructions for setting up template covers in esphomelib. - :image: description.svg + :image: description.png The ``template`` cover platform allows you to create simple covers out of just a few actions and a value lambda. Once defined, it will automatically appear in Home Assistant @@ -13,7 +13,7 @@ as a cover and can be controlled through the frontend. :align: center :width: 75.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry cover: diff --git a/esphomeyaml/components/dallas.rst b/esphomeyaml/components/dallas.rst index 706cd0a5f..b7791051d 100644 --- a/esphomeyaml/components/dallas.rst +++ b/esphomeyaml/components/dallas.rst @@ -17,7 +17,7 @@ sensors are connected to should have an external pullup resistor of about 4.7KΩ. For this, connect a resistor of *about* 4.7KΩ (values around that like 1Ω will, if you don't have massively long wires, work fine in most cases) between ``3.3V`` and the data pin. -.. code:: yaml +.. code-block:: yaml # Example configuration entry dallas: diff --git a/esphomeyaml/components/debug.rst b/esphomeyaml/components/debug.rst index bca6cbc03..7f62b110b 100644 --- a/esphomeyaml/components/debug.rst +++ b/esphomeyaml/components/debug.rst @@ -3,7 +3,7 @@ Debug Component .. seo:: :description: Instructions for setting up the debug component in esphomelib - :image: bug-report.svg + :image: bug-report.png The ``debug`` component can be used to debug problems with esphomelib. At startup, it prints a bunch of useful information like reset reason, free heap size, esphomelib version and so on. @@ -13,7 +13,7 @@ a bunch of useful information like reset reason, free heap size, esphomelib vers Example debug component output. -.. code:: yaml +.. code-block:: yaml # Example configuration entry debug: diff --git a/esphomeyaml/components/deep_sleep.rst b/esphomeyaml/components/deep_sleep.rst index 2a845c638..0f218ef3c 100644 --- a/esphomeyaml/components/deep_sleep.rst +++ b/esphomeyaml/components/deep_sleep.rst @@ -3,7 +3,7 @@ Deep Sleep Component .. seo:: :description: Instructions for setting up the deep sleep support for minimizing power consumption on ESPs. - :image: hotel.svg + :image: hotel.png The ``deep_sleep`` component can be used to automatically enter a deep sleep mode on the ESP8266/ESP32 after a certain amount of time. This is especially useful with nodes that operate @@ -23,7 +23,7 @@ to wake up on any RTC pin (``GPIO0``, ``GPIO2``, ``GPIO4``, ``GPIO12``, ``GPIO13 While in deep sleep mode, the node will not do any work and not respond to any network traffic, even Over The Air updates. -.. code:: yaml +.. code-block:: yaml # Example configuration entry deep_sleep: @@ -60,7 +60,7 @@ Advanced features: from the node to be displayed as "unavailable" while the node is in deep sleep mode. To disable availability reporting and not have any "unavailable" values, set ``birth_message`` and ``will_message`` to empty values: - .. code:: yaml + .. code-block:: yaml mqtt: # ... @@ -92,7 +92,7 @@ when the deep sleep should start? There are three ways of handling this using th This action makes the given deep sleep component enter deep sleep immediately. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -107,7 +107,7 @@ This action makes the given deep sleep component enter deep sleep immediately. This action prevents the given deep sleep component from entering deep sleep. Useful for -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -126,7 +126,7 @@ Useful for Remember to turn "OTA mode" off again after the OTA update by sending a MQTT message with the payload ``OFF``. - .. code:: yaml + .. code-block:: yaml deep_sleep: # ... diff --git a/esphomeyaml/components/display/index.rst b/esphomeyaml/components/display/index.rst index e3d24df0f..5b8298912 100644 --- a/esphomeyaml/components/display/index.rst +++ b/esphomeyaml/components/display/index.rst @@ -3,7 +3,7 @@ Display Component .. seo:: :description: Instructions for setting up the display integration. - :image: folder-open.svg + :image: folder-open.png The ``display`` component houses esphomelib's powerful rendering and display engine. Fundamentally, there are these types of displays: @@ -38,7 +38,7 @@ option called ``lambda:`` which will be called every time esphomelib wants to re In there, you can write code like in any :ref:`lambda ` in esphomeyaml. Display lambdas are additionally passed a variable called ``it`` which represents the rendering engine object. -.. code:: yaml +.. code-block:: yaml display: - platform: ... @@ -70,7 +70,7 @@ Basic Shapes Now that you know a bit more about esphomelib's coordinate system, let's draw some basic shapes like lines, rectangles and circles: -.. code:: yaml +.. code-block:: yaml display: - platform: ... @@ -92,7 +92,7 @@ All the above methods can optionally also be called with an argument at the end color to draw. Currently, only ``COLOR_ON`` (the default if color is not given) and ``COLOR_OFF`` are supported because esphomelib only has implemented binary displays. -.. code:: yaml +.. code-block:: yaml display: - platform: ... @@ -111,7 +111,7 @@ esphomelib only has implemented binary displays. Additionally, you have access to two helper methods which will fetch the width and height of the display: -.. code:: yaml +.. code-block:: yaml display: - platform: ... @@ -136,7 +136,7 @@ at **any** size! Granted the reason for it is actually not having to worry about To use fonts you first have to define a font object in your esphomeyaml configuration file. Just grab a ``.ttf`` file from somewhere on the Internet and create a ``font:`` section in your configuration: -.. code:: yaml +.. code-block:: yaml font: - file: "Comic Sans MS.ttf" @@ -172,7 +172,7 @@ Configuration variables: Then, in your display code just reference the font like so: -.. code:: yaml +.. code-block:: yaml display: - platform: ... @@ -188,7 +188,7 @@ When you enter ``[0,10]`` you're really telling esphomelib that it should positi at ``[0,10]``. When using a different alignment, like ``TOP_RIGHT``, the text will be positioned left of the anchor pointed, so that, as the name implies, the anchor point is a the *top right* corner of the text. -.. code:: yaml +.. code-block:: yaml display: - platform: ... @@ -202,7 +202,7 @@ pointed, so that, as the name implies, the anchor point is a the *top right* cor As with basic shapes, you can also specify a color for the text: -.. code:: yaml +.. code-block:: yaml display: - platform: ... @@ -225,7 +225,7 @@ is way better documented :) ``printf`` can do way more stuff than you will probably ever need, but it's also quite simple for the basic stuff. For example, a printf call can look like this: -.. code:: yaml +.. code-block:: yaml sensor: - platform: ... @@ -267,7 +267,7 @@ Another interesting format string is ``%7.2f``, which would become the right-jus You can even have as many format strings as you want in a single printf call. Just make sure the put the arguments after the format string in the right order. -.. code:: yaml +.. code-block:: yaml display: - platform: ... @@ -282,7 +282,7 @@ The last printf tip for use in displays I will discuss here is how to display bi you want to be efficient you can use an *inline if* too. With the ``%s`` print specifier you can tell it to use any string you pass it, like ``"ON"`` or ``"OFF"``. -.. code:: yaml +.. code-block:: yaml binary_sensor: - platform: ... @@ -316,7 +316,7 @@ With esphomelib you can also display the current time using the NTP protocol. Pl Images ^^^^^^ -.. code:: yaml +.. code-block:: yaml image: - file: "image.png" @@ -339,7 +339,7 @@ Configuration variables: And then later in code: -.. code:: yaml +.. code-block:: yaml display: - platform: ... diff --git a/esphomeyaml/components/display/lcd_gpio.rst b/esphomeyaml/components/display/lcd_gpio.rst index 431bfbc93..847088df9 100644 --- a/esphomeyaml/components/display/lcd_gpio.rst +++ b/esphomeyaml/components/display/lcd_gpio.rst @@ -21,7 +21,7 @@ commonly sold with a PCF8574 chip which only need two lines to the ESP, for that :align: center :width: 60.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry display: @@ -71,7 +71,7 @@ Each of the three methods (``print``, ``printf`` and ``strftime``) all optionall beginning which can be used to print the text at a specific position. These arguments are set to ``0`` (column) and ``0`` (row) by default which means the character at the top left. -.. code:: yaml +.. code-block:: yaml display: - platform: lcd_gpio # or lcd_pcf8574 diff --git a/esphomeyaml/components/display/lcd_pcf8574.rst b/esphomeyaml/components/display/lcd_pcf8574.rst index d2c70cb11..c8e077349 100644 --- a/esphomeyaml/components/display/lcd_pcf8574.rst +++ b/esphomeyaml/components/display/lcd_pcf8574.rst @@ -23,7 +23,7 @@ As the communication with the :ref:`I²C Bus `, you need to have an ``i2c:` :align: center :width: 60.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry i2c: diff --git a/esphomeyaml/components/display/max7219.rst b/esphomeyaml/components/display/max7219.rst index e0807389c..6e0282ab9 100644 --- a/esphomeyaml/components/display/max7219.rst +++ b/esphomeyaml/components/display/max7219.rst @@ -24,7 +24,7 @@ You can even daisy-chain multiple MAX7219s by connecting the DOUT of the previou next DIN. With more than ~3 chips the 3.3V will probably not be enough, so then you will have to potentially use a logic level converted. -.. code:: yaml +.. code-block:: yaml # Example configuration entry spi: @@ -75,7 +75,7 @@ the end of the first MAX7219, you would write ``it.print(7, "0");``. Also note that the ``.`` (dot) character is special because when esphomelib encounters it in the string the dot segment of the previous position will be enabled. -.. code:: yaml +.. code-block:: yaml display: - platform: max7219 diff --git a/esphomeyaml/components/display/nextion.rst b/esphomeyaml/components/display/nextion.rst index 13240f14c..164103382 100644 --- a/esphomeyaml/components/display/nextion.rst +++ b/esphomeyaml/components/display/nextion.rst @@ -24,7 +24,7 @@ As the communication with the MH-Z19 is done using UART, you need to have an :re in your configuration with ``rx_pin`` both the ``tx_pin`` set to the respective pins on the display. Additionally, you need to set the baud rate to 9600. -.. code:: yaml +.. code-block:: yaml # Example configuration entry uart: @@ -62,7 +62,7 @@ First, you need to use the `Nextion Editor ` - `Simple Nextion Library `__ by `Bentley Born `__ -- `Official Nextion Library `__ by `iTead `__ +- `Official Nextion Library `__ by `iTead `__ - `Edit this page on GitHub `__ .. disqus:: diff --git a/esphomeyaml/components/display/ssd1306_i2c.rst b/esphomeyaml/components/display/ssd1306_i2c.rst index 71a582fc3..8839fc212 100644 --- a/esphomeyaml/components/display/ssd1306_i2c.rst +++ b/esphomeyaml/components/display/ssd1306_i2c.rst @@ -21,7 +21,7 @@ Connect D0 to the SCL pin you chose for the :ref:`I²C Bus `, and connect D VCC to 3.3V and GND to GND. Optionally you can also connect the ``RESET`` pin to a pin on the ESP which may improve reliability. -.. code:: yaml +.. code-block:: yaml # Example configuration entry i2c: @@ -66,7 +66,7 @@ See Also - :doc:`index` - :doc:`API Reference ` -- `SSD1306 Library `__ by `Adafruit `__ +- `SSD1306 Library `__ by `Adafruit `__ - `Edit this page on GitHub `__ .. disqus:: diff --git a/esphomeyaml/components/display/ssd1306_spi.rst b/esphomeyaml/components/display/ssd1306_spi.rst index 338e72fe2..4d75172f1 100644 --- a/esphomeyaml/components/display/ssd1306_spi.rst +++ b/esphomeyaml/components/display/ssd1306_spi.rst @@ -22,7 +22,7 @@ to some GPIO pins on the ESP. For power, connect VCC to 3.3V and GND to GND. Optionally you can also connect the ``RESET`` pin to a pin on the ESP which may improve reliability. -.. code:: yaml +.. code-block:: yaml # Example configuration entry spi: @@ -71,7 +71,7 @@ See Also - :doc:`index` - :doc:`API Reference ` -- `SSD1306 Library `__ by `Adafruit `__ +- `SSD1306 Library `__ by `Adafruit `__ - `Edit this page on GitHub `__ .. disqus:: diff --git a/esphomeyaml/components/display/waveshare_epaper.rst b/esphomeyaml/components/display/waveshare_epaper.rst index 98dc4bcde..e842b0b4e 100644 --- a/esphomeyaml/components/display/waveshare_epaper.rst +++ b/esphomeyaml/components/display/waveshare_epaper.rst @@ -47,7 +47,7 @@ configuration. :align: center :width: 60.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry spi: diff --git a/esphomeyaml/components/esp32_ble_beacon.rst b/esphomeyaml/components/esp32_ble_beacon.rst index 5d2a49e13..dd1da7ca3 100644 --- a/esphomeyaml/components/esp32_ble_beacon.rst +++ b/esphomeyaml/components/esp32_ble_beacon.rst @@ -3,14 +3,14 @@ ESP32 Bluetooth Low Energy Beacon .. seo:: :description: Instructions for setting up Bluetooth Low Energy iBeacons using the BLE feature on ESP32s. - :image: bluetooth.svg + :image: bluetooth.png The ``esp32_ble_beacon`` component creates a Bluetooth Low Energy Beacon with your ESP32 device. Beacons are BLE devices that repeatedly just send out a pre-defined packet of data. This packet can then be received by devices like smartphones and can then be used to track a phone's location. -.. code:: yaml +.. code-block:: yaml # Example configuration entry esp32_ble_beacon: diff --git a/esphomeyaml/components/esp32_ble_tracker.rst b/esphomeyaml/components/esp32_ble_tracker.rst index 83e69edd0..7bd0d14bd 100644 --- a/esphomeyaml/components/esp32_ble_tracker.rst +++ b/esphomeyaml/components/esp32_ble_tracker.rst @@ -3,7 +3,7 @@ ESP32 Bluetooth Low Energy Tracker Hub .. seo:: :description: Instructions for setting up ESP32 bluetooth low energy device trackers using esphomelib. - :image: bluetooth.svg + :image: bluetooth.png The ``esp32_ble_tracker`` component creates a global hub so that you can track bluetooth low energy devices using your ESP32 node. @@ -11,7 +11,7 @@ energy devices using your ESP32 node. See :ref:`Setting up devices ` for information on how you can find out the MAC address of a device and track it using esphomelib. -.. code:: yaml +.. code-block:: yaml # Example configuration entry esp32_ble_tracker: diff --git a/esphomeyaml/components/esp32_touch.rst b/esphomeyaml/components/esp32_touch.rst index 8de673099..eeb89cba2 100644 --- a/esphomeyaml/components/esp32_touch.rst +++ b/esphomeyaml/components/esp32_touch.rst @@ -3,12 +3,12 @@ ESP32 Touch Pad Hub .. seo:: :description: Instructions for setting up the touch pad feature on the ESP32. - :image: touch.svg + :image: touch.png The ``esp32_touch`` component creates a global hub for detecting touches on the eight touch pads of the ESP32 as :doc:`binary senors `. -.. code:: yaml +.. code-block:: yaml # Example configuration entry esp32_touch: @@ -42,13 +42,13 @@ Advanced options (the defaults are usually quite good, but if you're having accu time for all touch pads. A longer conversion time means that more charge/discharge cycles of the touch pad can be performed, therefore increasing accuracy. Default is about 8ms, the maximum amount. - **low_voltage_reference** (*Optional*): The low voltage reference to use for the charge cycles. See - the `esp-idf docs `__ + the `esp-idf docs `__ for a nice explanation of this. One of ``0.5V``, ``0.6V``, ``0.7V``, ``0.8V``. Default is ``0.5V``. - **high_voltage_reference** (*Optional*): The high voltage reference to use for the charge cycles. See - the `esp-idf docs `__ + the `esp-idf docs `__ for a nice explanation of this. One of ``2.4V``, ``2.5V``, ``2.6V``, ``2.7V``. Default is ``2.7V``. - **voltage_attenuation** (*Optional*): The voltage attenuation to use for the charge cycles. See - the `esp-idf docs `__ + the `esp-idf docs `__ for a nice explanation of this. One of ``1.5V``, ``1V``, ``0.5V``, ``0V``. Default is ``0V``. See Also diff --git a/esphomeyaml/components/esphomeyaml.rst b/esphomeyaml/components/esphomeyaml.rst index ffd80e70d..5cc5392ff 100644 --- a/esphomeyaml/components/esphomeyaml.rst +++ b/esphomeyaml/components/esphomeyaml.rst @@ -3,14 +3,14 @@ esphomeyaml Core Configuration .. seo:: :description: Instructions for setting up the core esphomeyaml configuration. - :image: cloud-circle.svg + :image: cloud-circle.png Here you specify some core information that esphomeyaml needs to create firmwares. Most importantly, this is the section of the configuration where you specify the **name** of the node, the **platform** and **board** you’re using. -.. code:: yaml +.. code-block:: yaml # Example configuration entry esphomeyaml: @@ -67,7 +67,7 @@ using this configuration option. First, you can configure the use of either the latest esphomelib stable release (``latest``), the latest development code from GitHub (``dev``), or a specific version number (``1.8.0``). -.. code:: yaml +.. code-block:: yaml # Example configuration entry esphomeyaml: @@ -85,7 +85,7 @@ Alternatively, if you want to develop for esphomelib, you can download the `latest code from GitHub `, extract the contents, and point esphomeyaml to your local copy. Then you can modify the esphomelib to your needs or to fix bugs. -.. code:: yaml +.. code-block:: yaml # Example configuration entry esphomeyaml: @@ -96,7 +96,7 @@ and point esphomeyaml to your local copy. Then you can modify the esphomelib to And last, you can make esphomeyaml use a specific branch/commit/tag from a remote git repository: -.. code:: yaml +.. code-block:: yaml # Example configuration entry esphomeyaml: @@ -125,7 +125,7 @@ initializing the WiFi driver and so on. Unfortunately, every arduino framework v has its own quirks and bugs, especially concerning WiFi performance. With the ``arduino_version`` option you can tell esphomeyaml which arduino framework to use for compiling. -.. code:: yaml +.. code-block:: yaml # Example configuration entry esphomeyaml: @@ -167,7 +167,7 @@ For the ESP32, there's currently only one arduino framework version: This automation will be triggered when the ESP boots up. By default, it is executed after everything else is already set up. You can however change this using the ``priority`` parameter. -.. code:: yaml +.. code-block:: yaml esphomeyaml: # ... @@ -206,7 +206,7 @@ too many WiFi/MQTT connection attempts, Over-The-Air updates being applied or th It's not guaranteed that all components are in a connected state when this automation is triggered. For example, the MQTT client may have already disconnected. -.. code:: yaml +.. code-block:: yaml esphomeyaml: # ... @@ -223,7 +223,7 @@ Configuration variables: See :ref:`Automation `. This automation will be triggered on every ``loop()`` iteration (usually around every 16 milliseconds). -.. code:: yaml +.. code-block:: yaml esphomeyaml: # ... diff --git a/esphomeyaml/components/fan/binary.rst b/esphomeyaml/components/fan/binary.rst index fcc2f43e2..1727728f2 100644 --- a/esphomeyaml/components/fan/binary.rst +++ b/esphomeyaml/components/fan/binary.rst @@ -3,7 +3,7 @@ Binary Fan .. seo:: :description: Instructions for setting up binary fans. - :image: fan.svg + :image: fan.png The ``binary`` fan platform lets you represent any binary :ref:`output` as a fan. @@ -11,7 +11,7 @@ The ``binary`` fan platform lets you represent any binary :ref:`output` as a fan :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry fan: diff --git a/esphomeyaml/components/fan/index.rst b/esphomeyaml/components/fan/index.rst index 537dad95c..e9b931253 100644 --- a/esphomeyaml/components/fan/index.rst +++ b/esphomeyaml/components/fan/index.rst @@ -3,7 +3,7 @@ Fan Component .. seo:: :description: Instructions for setting up the base fan component. - :image: folder-open.svg + :image: folder-open.png With the ``fan`` domain you can create components that appear as fans in the Home Assistant frontend. A fan can be switched ON or OFF, optionally @@ -19,7 +19,7 @@ oscillate output. Base Fan Configuration ---------------------- -.. code:: yaml +.. code-block:: yaml fan: - platform: ... @@ -45,7 +45,7 @@ Configuration variables: Toggles the ON/OFF state of the fan with the given ID when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -58,7 +58,7 @@ Toggles the ON/OFF state of the fan with the given ID when executed. Turns the fan with the given ID off when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -71,7 +71,7 @@ Turns the fan with the given ID off when executed. Turns the fan with the given ID off when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: diff --git a/esphomeyaml/components/fan/speed.rst b/esphomeyaml/components/fan/speed.rst index f72854250..b31a7f23c 100644 --- a/esphomeyaml/components/fan/speed.rst +++ b/esphomeyaml/components/fan/speed.rst @@ -3,7 +3,7 @@ Speed Fan .. seo:: :description: Instructions for setting up speed-controllable fans. - :image: fan.svg + :image: fan.png The ``speed`` fan platform lets you represent any float :ref:`output` as a fan that supports speed settings. @@ -12,7 +12,7 @@ supports speed settings. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry fan: diff --git a/esphomeyaml/components/i2c.rst b/esphomeyaml/components/i2c.rst index 16c4725a3..f4e92d7ca 100644 --- a/esphomeyaml/components/i2c.rst +++ b/esphomeyaml/components/i2c.rst @@ -5,13 +5,13 @@ I²C Bus .. seo:: :description: Instructions for setting up the i2c bus to communicate with 2-wire devices in esphomelib - :image: i2c.svg + :image: i2c.png :keywords: i2c, iic, bus This component sets up the i²c bus for your ESP32 or ESP8266. In order for those components to work correctly, you need to define the i²c bus in your configuration. -.. code:: yaml +.. code-block:: yaml # Example configuration entry i2c: diff --git a/esphomeyaml/components/light/binary.rst b/esphomeyaml/components/light/binary.rst index 52acb3565..57ade694e 100644 --- a/esphomeyaml/components/light/binary.rst +++ b/esphomeyaml/components/light/binary.rst @@ -3,7 +3,7 @@ Binary Light .. seo:: :description: Instructions for setting up binary ON/OFF lights in esphomelib. - :image: lightbulb.svg + :image: lightbulb.png The ``binary`` light platform creates a simple ON/OFF-only light from a :ref:`binary output component `. @@ -12,7 +12,7 @@ The ``binary`` light platform creates a simple ON/OFF-only light from a :align: center :width: 40.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry light: diff --git a/esphomeyaml/components/light/cwww.rst b/esphomeyaml/components/light/cwww.rst index ca601ad7b..78660e8c9 100644 --- a/esphomeyaml/components/light/cwww.rst +++ b/esphomeyaml/components/light/cwww.rst @@ -3,13 +3,13 @@ Cold White + Warm White Light .. seo:: :description: Instructions for setting up Cold White + Warm White lights. - :image: brightness-medium.svg + :image: brightness-medium.png The ``cwww`` light platform creates an Cold-White+Warm-White light from 2 :ref:`float output components ` (one for each channel). The two channels will be mixed using the color temperature configuration options. -.. code:: yaml +.. code-block:: yaml # Example configuration entry light: diff --git a/esphomeyaml/components/light/fastled_clockless.rst b/esphomeyaml/components/light/fastled_clockless.rst index fab18bf50..461342350 100644 --- a/esphomeyaml/components/light/fastled_clockless.rst +++ b/esphomeyaml/components/light/fastled_clockless.rst @@ -3,7 +3,7 @@ FastLED Clockless Light .. seo:: :description: Instructions for setting up FastLED addressable lights like NEXTION. - :image: color_lens.svg + :image: color_lens.png The ``fastled_clockless`` light platform allows you to create RGB lights in esphomelib for a :ref:`number of supported chipsets `. @@ -15,7 +15,7 @@ Clockless FastLED lights differ from the :align: center :width: 60.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry light: diff --git a/esphomeyaml/components/light/fastled_spi.rst b/esphomeyaml/components/light/fastled_spi.rst index f4a806132..8863044b8 100644 --- a/esphomeyaml/components/light/fastled_spi.rst +++ b/esphomeyaml/components/light/fastled_spi.rst @@ -3,7 +3,7 @@ FastLED SPI Light .. seo:: :description: Instructions for setting up other FastLED addressable lights. - :image: color_lens.svg + :image: color_lens.png The ``fastled_spi`` light platform allows you to create RGB lights in esphomelib for a :ref:`number of supported chipsets `. @@ -16,7 +16,7 @@ whereas the clockless lights only need a single pin. :align: center :width: 60.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry light: diff --git a/esphomeyaml/components/light/index.rst b/esphomeyaml/components/light/index.rst index 28444de67..5383813da 100644 --- a/esphomeyaml/components/light/index.rst +++ b/esphomeyaml/components/light/index.rst @@ -3,7 +3,7 @@ Light Component .. seo:: :description: Instructions for setting up lights and light effects in esphomelib. - :image: folder-open.svg + :image: folder-open.png The ``light`` domain in esphomeyaml lets you create lights that will automatically be shown in Home Assistant’s frontend and have many @@ -16,7 +16,7 @@ features such as RGB colors, transitions, flashing and effects. This action toggles a light with the given ID when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -35,7 +35,7 @@ Configuration options: This action can also be expressed in :ref:`lambdas `: - .. code:: cpp + .. code-block:: cpp auto call = id(light_1).toggle(); // perform action: @@ -48,7 +48,7 @@ Configuration options: This action turns a light with the given ID on when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -93,7 +93,7 @@ Configuration options: This action can also be expressed in :ref:`lambdas `: - .. code:: cpp + .. code-block:: cpp auto call = id(light_1).turn_on(); // set parameters (optional) @@ -111,7 +111,7 @@ Configuration options: This action turns a light with the given ID off when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -131,7 +131,7 @@ Configuration options: This action can also be expressed in :ref:`lambdas `: - .. code:: cpp + .. code-block:: cpp auto call = id(light_1).turn_off(); // set parameters (optional) @@ -152,7 +152,7 @@ With esphomelib's light effects system you're basically creating a bunch of entr Home Assistant. If you wish to have several variants of the same effect you can of course also create multiple entries with each having a unique name like so: -.. code:: yaml +.. code-block:: yaml light: - platform: ... @@ -172,7 +172,7 @@ Random Effect This effect makes a transition (of length ``transition_length``) to a randomly-chosen color every ``update_interval``. -.. code:: yaml +.. code-block:: yaml light: - platform: ... @@ -196,7 +196,7 @@ Strobe Effect This effect cycles through a list of colors with specific durations. -.. code:: yaml +.. code-block:: yaml light: - platform: ... @@ -239,7 +239,7 @@ Flicker Effect This effect "hovers" around the active color of the light and flickers each color channel a bit. -.. code:: yaml +.. code-block:: yaml light: - platform: ... @@ -264,7 +264,7 @@ Lambda Effect This effect allows you to write completely custom light effects yourself using :ref:`lambdas `. -.. code:: yaml +.. code-block:: yaml light: - platform: ... @@ -302,7 +302,7 @@ FastLED Rainbow Effect A light effect for individually-addressable LEDs that creates a moving rainbow over the whole LED strip using the HSV color wheel. -.. code:: yaml +.. code-block:: yaml light: - platform: fastled_... @@ -327,7 +327,7 @@ FastLED Color Wipe Effect A light effect for individually-addressable LEDs that continuously introduces new colors at the beginning of the strip and shifts them forward every ``add_led_interval``. -.. code:: yaml +.. code-block:: yaml light: - platform: fastled_... @@ -371,7 +371,7 @@ FastLED Scan Effect Create a single, fast-moving dot moving back and forth an individually-addressable LED strip. The color is chosen by the currently active light color. -.. code:: yaml +.. code-block:: yaml light: - platform: fastled_... @@ -395,7 +395,7 @@ A light effect for individually-addressable LED strips that randomly chooses som up for a moment, like a stars twinkling in the night's sky. The color of the pixels will be chosen by the currently active light color. -.. code:: yaml +.. code-block:: yaml light: - platform: fastled_... @@ -420,7 +420,7 @@ FastLED Random Twinkle Effect A light effect similar to ``fastled_twinkle``, but using random colors for each twinkle animation. -.. code:: yaml +.. code-block:: yaml light: - platform: fastled_... @@ -447,7 +447,7 @@ FastLED Fireworks Effect A light effect for individually-addressable LED strips that randomly sparks some fireworks at random positions and lets the sparkles cascade over the LED strip. -.. code:: yaml +.. code-block:: yaml light: - platform: fastled_... @@ -480,7 +480,7 @@ FastLED Flicker Effect An effect similar to the ``flicker`` effect, but for individually-addressable LED strips. This effect flickers each LED by its own random amount around the currently active light color. -.. code:: yaml +.. code-block:: yaml light: - platform: fastled_... diff --git a/esphomeyaml/components/light/monochromatic.rst b/esphomeyaml/components/light/monochromatic.rst index fddc877fc..1167452aa 100644 --- a/esphomeyaml/components/light/monochromatic.rst +++ b/esphomeyaml/components/light/monochromatic.rst @@ -3,7 +3,7 @@ Monochromatic Light .. seo:: :description: Instructions for setting up monochromatic (brightness-only) lights. - :image: brightness-medium.svg + :image: brightness-medium.png The ``monochromatic`` light platform creates a simple brightness-only light from an :ref:`float output component `. @@ -18,7 +18,7 @@ The ``monochromatic`` light platform creates a simple brightness-only light from :align: center :width: 40.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry light: diff --git a/esphomeyaml/components/light/rgb.rst b/esphomeyaml/components/light/rgb.rst index 8fa28ce1f..286c966e3 100644 --- a/esphomeyaml/components/light/rgb.rst +++ b/esphomeyaml/components/light/rgb.rst @@ -18,7 +18,7 @@ The ``rgb`` light platform creates an RGB light from 3 :ref:`float output compon :align: center :width: 40.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry light: diff --git a/esphomeyaml/components/light/rgbw.rst b/esphomeyaml/components/light/rgbw.rst index 3f0ddf4ad..0fdefaec1 100644 --- a/esphomeyaml/components/light/rgbw.rst +++ b/esphomeyaml/components/light/rgbw.rst @@ -7,7 +7,7 @@ RGBW Light The ``rgbw`` light platform creates an RGBW light from 4 :ref:`float output components ` (one for each channel). -.. code:: yaml +.. code-block:: yaml # Example configuration entry light: diff --git a/esphomeyaml/components/light/rgbww.rst b/esphomeyaml/components/light/rgbww.rst index 89bfd8cc4..fc4e13d51 100644 --- a/esphomeyaml/components/light/rgbww.rst +++ b/esphomeyaml/components/light/rgbww.rst @@ -9,7 +9,7 @@ The ``rgbww`` light platform creates an RGBWW (cold white + warm white) light from 5 :ref:`float output components ` (one for each channel). The cold white and warm white channels will be mixed using the color temperature configuration options. -.. code:: yaml +.. code-block:: yaml # Example configuration entry light: diff --git a/esphomeyaml/components/logger.rst b/esphomeyaml/components/logger.rst index fa33f9394..bc94c5a90 100644 --- a/esphomeyaml/components/logger.rst +++ b/esphomeyaml/components/logger.rst @@ -3,14 +3,14 @@ Logger Component .. seo:: :description: Instructions for setting up the central logging component in esphomelib. - :image: file-document-box.svg + :image: file-document-box.png The logger component automatically logs all log messages through the serial port and through MQTT topics. By default, all logs with a severity higher than ``DEBUG`` will be shown. Decreasing the log level can help with the performance of the application and memory size. -.. code:: yaml +.. code-block:: yaml # Example configuration entry logger: @@ -64,7 +64,7 @@ the tag for MQTT components is ``mqtt.component``. Next, we can manually set the log levels in the configuration like this: -.. code:: yaml +.. code-block:: yaml logger: level: VERBOSE @@ -87,7 +87,7 @@ Print a formatted message to the logs. In the ``format`` option, you can use ``printf``-style formatting (see :ref:`display-printf`). -.. code:: yaml +.. code-block:: yaml on_...: then: diff --git a/esphomeyaml/components/mqtt.rst b/esphomeyaml/components/mqtt.rst index fdff7a415..45e67ffe5 100644 --- a/esphomeyaml/components/mqtt.rst +++ b/esphomeyaml/components/mqtt.rst @@ -12,7 +12,7 @@ just be able to copy over the `MQTT section `__ of your Home Assistant configuration. -.. code:: yaml +.. code-block:: yaml # Example configuration entry mqtt: @@ -72,7 +72,7 @@ MQTTMessage With the MQTT Message schema you can tell esphomeyaml how a specific MQTT message should be sent. It is used in several places like last will and birth messages or MQTT log options. -.. code:: yaml +.. code-block:: yaml # Simple: some_option: topic/to/send/to @@ -115,7 +115,7 @@ broker (like `mosquitto `__) and point both your Home Assistant installation and esphomelib to that broker. Next, enable discovery in your Home Assistant configuration with the following: -.. code:: yaml +.. code-block:: yaml # Example Home Assistant configuration.yaml entry mqtt: @@ -136,7 +136,7 @@ esphomeyaml anymore. To fix this, esphomeyaml has a simple helper script that purges stale retained messages for you: -.. code:: bash +.. code-block:: bash esphomeyaml configuration.yaml clean-mqtt @@ -184,7 +184,7 @@ broker to send a message ``/status`` with payload You can change these messages by overriding the ``birth_message`` and ``will_message`` with the following options. -.. code:: yaml +.. code-block:: yaml mqtt: # ... @@ -217,13 +217,13 @@ and with some computing power the fingerprint can be faked. To get this fingerprint, first put the broker and port options in the configuration and then run the ``mqtt-fingerprint`` script of esphomeyaml to get the certificate: -.. code:: bash +.. code-block:: bash esphomeyaml livingroom.yaml mqtt-fingerprint > SHA1 Fingerprint: a502ff13999f8b398ef1834f1123650b3236fc07 > Copy above string into mqtt.ssl_fingerprints section of livingroom.yaml -.. code:: yaml +.. code-block:: yaml mqtt: # ... @@ -238,7 +238,7 @@ MQTT Component Base Configuration All components in esphomelib that do some sort of communication through MQTT can have some overrides for specific options. -.. code:: yaml +.. code-block:: yaml name: "Component Name" # Optional variables: @@ -286,7 +286,7 @@ With this configuration option you can write complex automations whenever an MQT message on a specific topic is received. To use the message content, use a :ref:`lambda ` template, the message payload is available under the name ``x`` inside that lambda. -.. code:: yaml +.. code-block:: yaml mqtt: # ... @@ -304,11 +304,14 @@ Configuration variables: - **qos** (*Optional*, integer): The MQTT Quality of Service to subscribe to the topic with. Defaults to 0. +- **payload** (*Optional*, string): Optionally set a payload to match. Only if exactly the payload + you specify with this option is received, the automation will be executed. + .. note:: You can even specify multiple ``on_message`` triggers by using a YAML list: - .. code:: yaml + .. code-block:: yaml mqtt: on_message: @@ -323,7 +326,7 @@ Configuration variables: This action can also be used in :ref:`lambdas `: - .. code:: cpp + .. code-block:: cpp App.get_mqtt_client()->subscribe("the/topic", [=](const std::string &payload) { // do something with payload @@ -345,7 +348,7 @@ Basically, you can access elements by typing ``x["THE_KEY"]`` and save them into Please note that it's a good idea to check if the key exists in the Json Object by calling ``containsKey`` first as the ESP will crash if an element that does not exist is accessed. -.. code:: yaml +.. code-block:: yaml mqtt: # ... @@ -386,7 +389,7 @@ Configuration variables: This action can also be used in :ref:`lambdas `: - .. code:: cpp + .. code-block:: cpp App.get_mqtt_client()->subscribe_json("the/topic", [=](JsonObject &root) { // do something with JSON-decoded value root @@ -399,7 +402,7 @@ Configuration variables: Publish an MQTT message on a topic using this action in automations. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -431,13 +434,13 @@ Configuration options: This action can also be written in :ref:`lambdas `: - .. code:: yaml + .. code-block:: yaml mqtt: # Give the mqtt component an ID id: mqtt_client - .. code:: cpp + .. code-block:: cpp id(mqtt_client).publish("the/topic", "The Payload"); @@ -453,7 +456,7 @@ In the ``payload`` option you have access to a ``root`` object which will repres of the JSON message. You can assign values to keys by using the ``root["KEY_NAME"] = VALUE;`` syntax as seen below. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -482,13 +485,13 @@ Configuration options: This action can also be written in :ref:`lambdas `: - .. code:: yaml + .. code-block:: yaml mqtt: # Give the mqtt component an ID id: mqtt_client - .. code:: cpp + .. code-block:: cpp id(mqtt_client).publish_json("the/topic", [=](JsonObject &root) { root["something"] = id(my_sensor).value; diff --git a/esphomeyaml/components/my9231.rst b/esphomeyaml/components/my9231.rst index ad6f03cc2..3c107d4df 100644 --- a/esphomeyaml/components/my9231.rst +++ b/esphomeyaml/components/my9231.rst @@ -3,7 +3,7 @@ MY9231/MY9291 LED driver Component .. seo:: :description: Instructions for setting up MY9231 and MY9291 LED drives in esphomelib. - :image: my9231.svg + :image: my9231.png :keywords: MY9231, MY9291, Sonoff B1, Ai-thinker AiLight WiFi light bulb, Arilux E27 Smart Bulb The MY9231/MY9291 component represents a MY9231/MY9291 LED diver chain @@ -40,7 +40,7 @@ global ``my9231`` hub and give it an id, and then define the internal data will not reflect this state. Thus, the first fade is wrong, as well as the MQTT state. -.. code:: yaml +.. code-block:: yaml # Example configuration entry my9231: @@ -83,7 +83,7 @@ about flashing Sonoff devices, see: chain of two MY9321 chips that are connected to GPIO12 and GPIO14. A complete configuration for a Sonoff B1 looks like: -.. code:: yaml +.. code-block:: yaml esphomeyaml: name: diff --git a/esphomeyaml/components/ota.rst b/esphomeyaml/components/ota.rst index b0fa19b23..f14ab47a6 100644 --- a/esphomeyaml/components/ota.rst +++ b/esphomeyaml/components/ota.rst @@ -3,7 +3,7 @@ OTA Update Component .. seo:: :description: Instructions for setting up Over-The-Air (OTA) updates for ESPs to upload firmwares remotely. - :image: system-update.svg + :image: system-update.png :keywords: Xiaomi, Mi Flora, BLE, Bluetooth With the OTA (Over The Air) update component you can upload your @@ -32,7 +32,7 @@ this and will go over into a safe mode after 10 unsuccessful boot attempts. In that mode, all components are disabled and only Serial Logging+WiFi+OTA are initialized, so that you can upload a new binary. -.. code:: yaml +.. code-block:: yaml # Example configuration entry ota: diff --git a/esphomeyaml/components/output/esp8266_pwm.rst b/esphomeyaml/components/output/esp8266_pwm.rst index 5e2b22c48..0a123a988 100644 --- a/esphomeyaml/components/output/esp8266_pwm.rst +++ b/esphomeyaml/components/output/esp8266_pwm.rst @@ -16,7 +16,7 @@ limitations. If you need a stable PWM signal, it’s definitely recommended to use the successor of the ESP8266, the ESP32, and its :doc:`ESP32 LEDC PWM ` instead. -.. code:: yaml +.. code-block:: yaml # Example configuration entry output: diff --git a/esphomeyaml/components/output/gpio.rst b/esphomeyaml/components/output/gpio.rst index 153d971a6..df6899073 100644 --- a/esphomeyaml/components/output/gpio.rst +++ b/esphomeyaml/components/output/gpio.rst @@ -3,13 +3,13 @@ GPIO Output .. seo:: :description: Instructions for setting up binary outputs for GPIO pins. - :image: pin.svg + :image: pin.png The GPIO output component is quite simple: It exposes a single GPIO pin as an output component. Note that output components are **not** switches and will not show up in Home Assistant. See :doc:`GPIO Switch `. -.. code:: yaml +.. code-block:: yaml # Example configuration entry output: diff --git a/esphomeyaml/components/output/index.rst b/esphomeyaml/components/output/index.rst index 08c3f71a4..9d78ee672 100644 --- a/esphomeyaml/components/output/index.rst +++ b/esphomeyaml/components/output/index.rst @@ -5,7 +5,7 @@ Output Component .. seo:: :description: Instructions for setting up generic outputs in esphomelib - :image: folder-open.svg + :image: folder-open.png Each platform of the ``output`` domain exposes some output to esphomelib. These are grouped into two categories: ``binary`` outputs @@ -19,7 +19,7 @@ Base Output Configuration Each output platform extends this configuration schema. -.. code:: yaml +.. code-block:: yaml # Example configuration entry output: @@ -50,7 +50,7 @@ Configuration variables: This action turns the output with the given ID on when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -60,7 +60,7 @@ This action turns the output with the given ID on when executed. This action can also be expressed in :ref:`lambdas `: - .. code:: cpp + .. code-block:: cpp id(relay_1).turn_on(); @@ -71,7 +71,7 @@ This action turns the output with the given ID on when executed. This action turns the output with the given ID off when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -81,7 +81,7 @@ This action turns the output with the given ID off when executed. This action can also be expressed in :ref:`lambdas `: - .. code:: cpp + .. code-block:: cpp id(relay_1).turn_off(); @@ -93,7 +93,7 @@ This action turns the output with the given ID off when executed. This action sets the float output to the given level when executed. Note: This only works with floating point outputs like ESP8266 PWM or LEDC. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -105,7 +105,7 @@ works with floating point outputs like ESP8266 PWM or LEDC. This action can also be expressed in :ref:`lambdas `: - .. code:: cpp + .. code-block:: cpp // range is 0.0 (off) to 1.0 (on) id(relay_1).set_level(0.5); diff --git a/esphomeyaml/components/output/ledc.rst b/esphomeyaml/components/output/ledc.rst index 1f364e6ea..9e54a0572 100644 --- a/esphomeyaml/components/output/ledc.rst +++ b/esphomeyaml/components/output/ledc.rst @@ -6,10 +6,10 @@ ESP32 LEDC Output :image: pwm.png The LEDC output component exposes a `LEDC PWM -channel `__ +channel `__ of the ESP32 as an output component. -.. code:: yaml +.. code-block:: yaml # Example configuration entry output: @@ -27,7 +27,7 @@ Configuration variables: therefore also the same frequency. Defaults to 1000Hz. - **bit_depth** (*Optional*, int): The bit depth to use for the LEDC channel. Defaults to 12. - **channel** (*Optional*, int): Manually set the `LEDC - channel `__ + channel `__ to use. Two adjacent channels share the same timer. Defaults to an automatic selection. - All other options from :ref:`Output `. @@ -40,7 +40,7 @@ See Also - :doc:`/esphomeyaml/components/fan/speed` - :doc:`/esphomeyaml/components/power_supply` - :doc:`API Reference ` -- `esp-idf LEDC API docs `__ +- `esp-idf LEDC API docs `__ - `Edit this page on GitHub `__ .. disqus:: diff --git a/esphomeyaml/components/output/my9231.rst b/esphomeyaml/components/output/my9231.rst index b7da82510..8b6e7aca2 100644 --- a/esphomeyaml/components/output/my9231.rst +++ b/esphomeyaml/components/output/my9231.rst @@ -3,12 +3,12 @@ MY9231/MY9291 Output .. seo:: :description: Instructions for setting up MY931 and MY9231 outputs. - :image: my9231.svg + :image: my9231.png The MY931/MY9291 output component exposes a MY931/MY9291 channel of a global :doc:`/esphomeyaml/components/my9231` as a float output. -.. code:: yaml +.. code-block:: yaml # Example configuration entry my9231: diff --git a/esphomeyaml/components/output/pca9685.rst b/esphomeyaml/components/output/pca9685.rst index a6db27eff..67f2461b1 100644 --- a/esphomeyaml/components/output/pca9685.rst +++ b/esphomeyaml/components/output/pca9685.rst @@ -15,7 +15,7 @@ output. PCA9685 16-Channel PWM Driver. -.. code:: yaml +.. code-block:: yaml # Example configuration entry pca9685: diff --git a/esphomeyaml/components/pca9685.rst b/esphomeyaml/components/pca9685.rst index 9a2e849a6..e20ce7157 100644 --- a/esphomeyaml/components/pca9685.rst +++ b/esphomeyaml/components/pca9685.rst @@ -7,7 +7,7 @@ PCA9685 PWM Component :keywords: PCA9685 The PCA9685 component represents a PCA9685 12-bit PWM driver -(`datasheet `__, +(`datasheet `__, `adafruit `__) in esphomelib. It uses :ref:`I²C Bus ` for communication. @@ -15,7 +15,7 @@ To use the channels of this components, you first need to setup the global ``pca9685`` hub and give it an id, and then define the :doc:`individual output channels `. -.. code:: yaml +.. code-block:: yaml # Example configuration entry pca9685: diff --git a/esphomeyaml/components/pcf8574.rst b/esphomeyaml/components/pcf8574.rst index 21e03866c..edc6de1ed 100644 --- a/esphomeyaml/components/pcf8574.rst +++ b/esphomeyaml/components/pcf8574.rst @@ -27,7 +27,7 @@ not work. .. _Sparkfun: https://www.sparkfun.com/products/retired/8130 -.. code:: yaml +.. code-block:: yaml # Example configuration entry pcf8574: diff --git a/esphomeyaml/components/pn532.rst b/esphomeyaml/components/pn532.rst index 23c0a01b3..63765e897 100644 --- a/esphomeyaml/components/pn532.rst +++ b/esphomeyaml/components/pn532.rst @@ -22,7 +22,7 @@ As the communication with the PN532 is done using SPI for this integration, you the board to the SPI mode (usually by setting the first one to OFF and the second one to ON). Additionally, you need to have an :ref:`spi bus ` in your configuration with both the **miso_pin** and **mosi_pin** set. -.. code:: yaml +.. code-block:: yaml # Example configuration entry spi: @@ -71,7 +71,7 @@ if the tag is re-read many times. The parameter ``x`` this trigger provides is of type ``std::string`` and is the tag UID in the format ``74-10-37-94``. The configuration below will for example publish the tag ID on the MQTT topic ``pn532/tag``. -.. code:: yaml +.. code-block:: yaml pn532: # ... diff --git a/esphomeyaml/components/power_supply.rst b/esphomeyaml/components/power_supply.rst index 8569ba415..f64bd2a2d 100644 --- a/esphomeyaml/components/power_supply.rst +++ b/esphomeyaml/components/power_supply.rst @@ -3,7 +3,7 @@ Power Supply Component .. seo:: :description: Instructions for setting up power supplies which will automatically turn on together with outputs. - :image: power.svg + :image: power.png :keywords: power, ATX The ``power_supply`` component allows you to have a high power mode for @@ -16,7 +16,7 @@ will automatically switch on if any of the outputs are on. Furthermore, it also has a cooldown time that keeps the power supply on for a while after the last output has been disabled. -.. code:: yaml +.. code-block:: yaml # Example configuration entry power_supply: @@ -53,7 +53,7 @@ pin up when high power mode is needed. Most ATX power supplies however operate with an active-low configuration. Therefore their output needs to be inverted. -.. code:: yaml +.. code-block:: yaml power_supply: - id: 'atx_power_supply' diff --git a/esphomeyaml/components/rdm6300.rst b/esphomeyaml/components/rdm6300.rst index 0b871e6a8..6a87230ff 100644 --- a/esphomeyaml/components/rdm6300.rst +++ b/esphomeyaml/components/rdm6300.rst @@ -22,7 +22,7 @@ As the communication with the RDM6300 is done using UART, you need to have an :ref:`UART bus ` in your configuration with the ``rx_pin`` connected to the data pin of the RDM6300 and with the baud rate set to 9600 -.. code:: yaml +.. code-block:: yaml # Example configuration entry uart: diff --git a/esphomeyaml/components/remote_receiver.rst b/esphomeyaml/components/remote_receiver.rst index 753bbd5b8..63fca29c3 100644 --- a/esphomeyaml/components/remote_receiver.rst +++ b/esphomeyaml/components/remote_receiver.rst @@ -3,7 +3,7 @@ Remote Receiver Component .. seo:: :description: Instructions for setting up remote receivers in esphomelib. - :image: remote.svg + :image: remote.png :keywords: RF, infrared The ``remote_receiver`` component lets you receive and decode any remote signal, these can @@ -14,7 +14,7 @@ receive, decode and dump all remote codes, and individual :doc:`remote receiver binary sensors ` which will trigger when they hear their own configured signal. -.. code:: yaml +.. code-block:: yaml # Example configuration entry remote_receiver: diff --git a/esphomeyaml/components/remote_transmitter.rst b/esphomeyaml/components/remote_transmitter.rst index fb3783387..03c9e53c3 100644 --- a/esphomeyaml/components/remote_transmitter.rst +++ b/esphomeyaml/components/remote_transmitter.rst @@ -3,7 +3,7 @@ Remote Transmitter Component .. seo:: :description: Instructions for setting up remote transmitters in esphomelib - :image: remote.svg + :image: remote.png :keywords: RF, infrared The ``remote_transmitter`` component lets you send infrared messages to control @@ -18,7 +18,7 @@ Use-cases are for example infrared remotes or 433MHz signals. This component is *much* more accurate on the ESP32, since that chipset has a dedicated peripheral for sending exact signal sequences. -.. code:: yaml +.. code-block:: yaml # Example configuration entry remote_transmitter: diff --git a/esphomeyaml/components/sensor/adc.rst b/esphomeyaml/components/sensor/adc.rst index 03b889e25..a068c50bd 100644 --- a/esphomeyaml/components/sensor/adc.rst +++ b/esphomeyaml/components/sensor/adc.rst @@ -3,7 +3,7 @@ Analog To Digital Sensor .. seo:: :description: Instructions for setting up built-in analog voltage sensors. - :image: flash.svg + :image: flash.png The Analog To Digital (``adc``) Sensor allows you to use the built-in ADC in your device to measure a voltage on certain pins. On the ESP8266 @@ -14,7 +14,7 @@ GPIO39 can be used. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: @@ -50,7 +50,7 @@ On the ESP32, the voltage measured with the ADC caps out at 1.1V by default as t or the attenuation of the ADC is set to ``0db`` by default. To measure voltages higher than 1.1V, set ``attenuation`` to one of the `following values -`__: +`__: - ``0db`` for a full-scale voltage of 1.1V (default) - ``2.5db`` for a full-scale voltage of 1.5V @@ -67,7 +67,7 @@ where you want to shut down the chip if the voltage is low when using a battery. To measure the VCC voltage, set ``pin:`` to ``VCC`` and make sure nothing is connected to the ``A0`` pin. -.. code:: yaml +.. code-block:: yaml sensor: - platform: adc diff --git a/esphomeyaml/components/sensor/ads1115.rst b/esphomeyaml/components/sensor/ads1115.rst index f97e0b9fc..53758a2fe 100644 --- a/esphomeyaml/components/sensor/ads1115.rst +++ b/esphomeyaml/components/sensor/ads1115.rst @@ -24,7 +24,7 @@ voltage to Home Assistant. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml ads1115: - address: 0x48 diff --git a/esphomeyaml/components/sensor/bh1750.rst b/esphomeyaml/components/sensor/bh1750.rst index 224baf865..d6cbac7ca 100644 --- a/esphomeyaml/components/sensor/bh1750.rst +++ b/esphomeyaml/components/sensor/bh1750.rst @@ -24,7 +24,7 @@ your configuration for this sensor to work. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/ble_rssi.rst b/esphomeyaml/components/sensor/ble_rssi.rst index e1a2629e4..3d56f1c70 100644 --- a/esphomeyaml/components/sensor/ble_rssi.rst +++ b/esphomeyaml/components/sensor/ble_rssi.rst @@ -3,14 +3,14 @@ ESP32 Bluetooth Low Energy RSSI Sensor .. seo:: :description: Instructions for setting up RSSI sensors for the ESP32 BLE. - :image: bluetooth.svg + :image: bluetooth.png :keywords: ESP32 The ``ble_rssi`` sensor platform lets you track the RSSI value or signal strength of a BLE device. See :ref:`the binary sensor setup ` for instructions for setting up this platform. -.. code:: yaml +.. code-block:: yaml # Example configuration entry esp32_ble_tracker: diff --git a/esphomeyaml/components/sensor/bme280.rst b/esphomeyaml/components/sensor/bme280.rst index 204fb72b2..1ccb21141 100644 --- a/esphomeyaml/components/sensor/bme280.rst +++ b/esphomeyaml/components/sensor/bme280.rst @@ -19,7 +19,7 @@ required to be set up in your configuration for this sensor to work. .. _Adafruit: https://www.adafruit.com/product/2652 -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/bme680.rst b/esphomeyaml/components/sensor/bme680.rst index d4a8d516e..e1a98ab24 100644 --- a/esphomeyaml/components/sensor/bme680.rst +++ b/esphomeyaml/components/sensor/bme680.rst @@ -19,7 +19,7 @@ your configuration for this sensor to work. .. _Adafruit: https://www.adafruit.com/product/3660 -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/bmp085.rst b/esphomeyaml/components/sensor/bmp085.rst index d6b1ef376..91993bf3c 100644 --- a/esphomeyaml/components/sensor/bmp085.rst +++ b/esphomeyaml/components/sensor/bmp085.rst @@ -24,7 +24,7 @@ your configuration for this sensor to work. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/bmp280.rst b/esphomeyaml/components/sensor/bmp280.rst index a82a8350e..bf6e5d17c 100644 --- a/esphomeyaml/components/sensor/bmp280.rst +++ b/esphomeyaml/components/sensor/bmp280.rst @@ -19,7 +19,7 @@ required to be set up in your configuration for this sensor to work. .. _Adafruit: https://www.adafruit.com/product/2651 -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/cse7766.rst b/esphomeyaml/components/sensor/cse7766.rst index ea231bf8f..1ed0d0892 100644 --- a/esphomeyaml/components/sensor/cse7766.rst +++ b/esphomeyaml/components/sensor/cse7766.rst @@ -3,7 +3,7 @@ CSE7766 Power Sensor .. seo:: :description: Instructions for setting up CSE7766 power sensors for the Sonoff Pow R2 - :image: cse7766.svg + :image: cse7766.png :keywords: cse7766, Sonoff Pow R2 .. warning:: @@ -19,7 +19,7 @@ As the communication with the CSE7766 done using UART, you need to have an :ref:`UART bus ` in your configuration with the ``rx_pin`` connected to the CSE7766. Additionally, you need to set the baud rate to 4800. -.. code:: yaml +.. code-block:: yaml # Example configuration entry # Disable logging over USB diff --git a/esphomeyaml/components/sensor/custom.rst b/esphomeyaml/components/sensor/custom.rst index b0f599628..d02759d15 100644 --- a/esphomeyaml/components/sensor/custom.rst +++ b/esphomeyaml/components/sensor/custom.rst @@ -3,7 +3,7 @@ Custom Sensor Component .. seo:: :description: Instructions for setting up Custom C++ sensors with esphomelib. - :image: language-cpp.svg + :image: language-cpp.png :keywords: C++, Custom .. warning:: @@ -27,15 +27,16 @@ esphomelib can use 2. go over how to register the sensor so that it will be show Since the creation of this guide, the BMP180 has been officially supported by the :doc:`BMP085 component `. The code still applies though. -This guide will require at least a bit of knowledge of C++, so be prepared for that. If you have any problems, -I'm here to help :) https://discord.gg/KhAMKrd +This guide will require at least a bit of knowledge of C++, so be prepared for that. If you've already written +code for an Arduino, you have already written C++ code :) (Arduino uses a slightly customized version of C++). +If you have any problems, I'm here to help: https://discord.gg/KhAMKrd Step 1: Custom Sensor Definition -------------------------------- At this point, you might have a main source file like this: -.. code:: cpp +.. code-block:: cpp // ... using namespace esphomelib; @@ -57,7 +58,7 @@ At this point, you might have a main source file like this: To create your own custom sensor, you just have define a C++ class that extends ``Component`` and ``Sensor`` like this: -.. code:: cpp +.. code-block:: cpp using namespace esphomelib; @@ -79,7 +80,7 @@ To create your own custom sensor, you just have define a C++ class that extends Additionally, you need to change an internal flag that changes how esphomeyaml compiles files. The only downside is that this will make build times *a tiny bit* slower: -.. code:: yaml +.. code-block:: yaml esphomeyaml: # ... @@ -99,7 +100,7 @@ to do in an Arduino sketch. Let's now also take a closer look at this line, which you might not be too used to when writing pure C code: -.. code:: cpp +.. code-block:: cpp class CustomSensor : public Component, public sensor::Sensor { @@ -112,7 +113,7 @@ values to the frontend (like MQTT). As most sensors really just setup some pins and then check the sensor every x seconds, there's another abstraction that we'll use to simplify our code: ``PollingSensorComponent``. -.. code:: cpp +.. code-block:: cpp class CustomSensor : public sensor::PollingSensorComponent { public: @@ -138,7 +139,7 @@ in the Internet. Let's also now make our sensor actually *output* values (42 for now): -.. code:: cpp +.. code-block:: cpp // class CustomSensor ... // ... previous code @@ -164,6 +165,8 @@ so esphomelib can't know about it. Let's change that. In your global ``setup()`` method, after you've setup all other components, do the following: +.. code-block:: yaml + .. code:: cpp void setup() { @@ -189,14 +192,14 @@ Let's go through the code for registering our custom sensor. First, we're creati instance with the update interval of 5000ms using the ``new`` C++ syntax (important!) and assigning it to a variable ``custom_sensor`` (using C++11 ``auto`` type specifier to make it simpler). -.. code:: cpp +.. code-block:: cpp auto *custom_sensor = new CustomSensor(5000); Next, we *register* the component in esphomelib's Application instance so that it can call the component's ``setup()`` and ``loop()``. -.. code:: cpp +.. code-block:: cpp App.register_component(custom_sensor); @@ -221,7 +224,7 @@ library by Adafruit. First we'll need to add the library to our platformio dependencies. To do so, put the following in the ``common`` section of your ``platformio.ini``: -.. code:: ini +.. code-block:: ini [common] lib_deps = Adafruit BMP085 Library @@ -230,7 +233,7 @@ the ``common`` section of your ``platformio.ini``: Next, include the library at the top of you main sketch file (``/src/main.cpp``): -.. code:: cpp +.. code-block:: cpp #include "esphomelib/application.h" #include @@ -241,7 +244,7 @@ Next, include the library at the top of you main sketch file (``/src/ Then update our sensor for BMP180 support: -.. code:: cpp +.. code-block:: cpp // ... @@ -297,7 +300,7 @@ we want to expose. Let's look at what that could look like in code: -.. code:: cpp +.. code-block:: cpp // An empty sensor subclass that will "proxy" the temperature values diff --git a/esphomeyaml/components/sensor/dallas.rst b/esphomeyaml/components/sensor/dallas.rst index 1fe836a72..e43bd17ab 100644 --- a/esphomeyaml/components/sensor/dallas.rst +++ b/esphomeyaml/components/sensor/dallas.rst @@ -26,7 +26,7 @@ To initialize a sensor, first supply either ``address`` **or** ``index`` to iden :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry dallas: @@ -67,7 +67,7 @@ level ` must be set to at least ``debug``!). Note that you don't need to define the individual sensors just yet, as the scanning will happen even with no sensors connected. For example with this configuration: -.. code:: yaml +.. code-block:: yaml # Example configuration entry dallas: @@ -81,7 +81,7 @@ You will find something like this: Now we can add the individual sensors to our configuration: -.. code:: yaml +.. code-block:: yaml # Example configuration entry dallas: diff --git a/esphomeyaml/components/sensor/dht.rst b/esphomeyaml/components/sensor/dht.rst index f2c1c97ec..774739bba 100644 --- a/esphomeyaml/components/sensor/dht.rst +++ b/esphomeyaml/components/sensor/dht.rst @@ -33,7 +33,7 @@ if you're having issues try the 4.7kΩ recommended by the manufacturer) between :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/dht12.rst b/esphomeyaml/components/sensor/dht12.rst index 63da3cb22..c38046a08 100644 --- a/esphomeyaml/components/sensor/dht12.rst +++ b/esphomeyaml/components/sensor/dht12.rst @@ -22,7 +22,7 @@ The ``dht12`` Temperature+Humidity sensor allows you to use your DHT12 :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/duty_cycle.rst b/esphomeyaml/components/sensor/duty_cycle.rst index 0ab62c94b..bcd074e80 100644 --- a/esphomeyaml/components/sensor/duty_cycle.rst +++ b/esphomeyaml/components/sensor/duty_cycle.rst @@ -3,7 +3,7 @@ Duty Cycle Sensor .. seo:: :description: Instructions for setting up duty cycle sensors in esphomelib - :image: percent.svg + :image: percent.png The duty cycle sensor allows you to measure for what percentage of time a signal on a GPIO pin is HIGH or LOW. @@ -15,7 +15,7 @@ For example, you can measure if a status LED of a pool controller is permanently :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/esp32_hall.rst b/esphomeyaml/components/sensor/esp32_hall.rst index 8efeb91b2..231bf7ff6 100644 --- a/esphomeyaml/components/sensor/esp32_hall.rst +++ b/esphomeyaml/components/sensor/esp32_hall.rst @@ -3,7 +3,7 @@ ESP32 Hall Sensor .. seo:: :description: Instructions for setting up the integrated hall-effect sensor of the ESP32. - :image: magnet.svg + :image: magnet.png :keywords: esp32, hall The ``esp32_hall`` sensor platform allows you to use the integrated @@ -19,7 +19,7 @@ by the hall sensor. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/hdc1080.rst b/esphomeyaml/components/sensor/hdc1080.rst index a1e93b966..470becf52 100644 --- a/esphomeyaml/components/sensor/hdc1080.rst +++ b/esphomeyaml/components/sensor/hdc1080.rst @@ -25,7 +25,7 @@ required to be set up in your configuration for this sensor to work. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/hlw8012.rst b/esphomeyaml/components/sensor/hlw8012.rst index ad0d27a3f..14501e595 100644 --- a/esphomeyaml/components/sensor/hlw8012.rst +++ b/esphomeyaml/components/sensor/hlw8012.rst @@ -3,7 +3,7 @@ HLW8012 Power Sensor .. seo:: :description: Instructions for setting up HLW8012 power sensors for the Sonoff Pow R1 - :image: hlw8012.svg + :image: hlw8012.png :keywords: HLW8012, Sonoff Pow R1 The ``hlw8012`` sensor platform allows you to use your HLW8012 voltage/current and power sensors @@ -17,7 +17,7 @@ the SEL pin, one can choose between which mode to use. esphomelib will continuously cycle the state of the SEL pin to measure current *and* voltage, though both cannot be measured at the same exact points in time. -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/hmc5883l.rst b/esphomeyaml/components/sensor/hmc5883l.rst index c0b2561f6..7eb58b0cb 100644 --- a/esphomeyaml/components/sensor/hmc5883l.rst +++ b/esphomeyaml/components/sensor/hmc5883l.rst @@ -14,7 +14,7 @@ required to be set up in your configuration for this sensor to work. .. _Adafruit: https://www.adafruit.com/product/1746 -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/htu21d.rst b/esphomeyaml/components/sensor/htu21d.rst index 44315444a..45933e39f 100644 --- a/esphomeyaml/components/sensor/htu21d.rst +++ b/esphomeyaml/components/sensor/htu21d.rst @@ -7,7 +7,7 @@ HTU21D Temperature+Humidity Sensor :keywords: HTU21D The HTU21D Temperature+Humidity sensor allows you to use your HTU21D -(`datasheet `__, +(`datasheet `__, `adafruit `__) sensors with esphomelib. The :ref:`I²C Bus ` is required to be set up in your configuration for this sensor to work. @@ -28,7 +28,7 @@ required to be set up in your configuration for this sensor to work. The **SI7021** sensor also works with this integration. -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/hx711.rst b/esphomeyaml/components/sensor/hx711.rst index 2d0f02680..e5aadb5b4 100644 --- a/esphomeyaml/components/sensor/hx711.rst +++ b/esphomeyaml/components/sensor/hx711.rst @@ -3,7 +3,7 @@ HX711 Load Cell Amplifier .. seo:: :description: Instructions for setting up HX711 load cell amplifiers with esphomelib - :image: hx711.svg + :image: hx711.png :keywords: HX711 The ``hx711`` sensor platform allows you to use your HX711 @@ -22,7 +22,7 @@ load cell amplifier Connect ``GND`` to ``GND``, ``VCC`` to ``3.3V`` and the other three ``MISO`` (or ``SO`` for short), ``CS`` and ``CLOCK`` (or ``SCK``) to free GPIO pins. -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: @@ -58,7 +58,7 @@ To calibrate the sensor: Once you've done those steps, you can use the ``map`` function to map the incoming value to the calibrated one: -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/ina219.rst b/esphomeyaml/components/sensor/ina219.rst index d76e34c1e..e80b7e2ac 100644 --- a/esphomeyaml/components/sensor/ina219.rst +++ b/esphomeyaml/components/sensor/ina219.rst @@ -25,7 +25,7 @@ required to be set up in your configuration for this sensor to work. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/ina3221.rst b/esphomeyaml/components/sensor/ina3221.rst index 66cac134a..7a9e5a781 100644 --- a/esphomeyaml/components/sensor/ina3221.rst +++ b/esphomeyaml/components/sensor/ina3221.rst @@ -25,7 +25,7 @@ required to be set up in your configuration for this sensor to work. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/index.rst b/esphomeyaml/components/sensor/index.rst index 90b4654dc..5eb96ecaa 100644 --- a/esphomeyaml/components/sensor/index.rst +++ b/esphomeyaml/components/sensor/index.rst @@ -3,7 +3,7 @@ Sensor Component .. seo:: :description: Instructions for setting up sensor components in esphomelib. - :image: folder-open.svg + :image: folder-open.png esphomelib has support for many different sensors. Each of them is a platform of the ``sensor`` domain and each sensor has several base @@ -19,7 +19,7 @@ optional configuration options. By default, the sensor platform will chose appropriate values for all of these by default, but you can always override them if you want to. -.. code:: yaml +.. code-block:: yaml # Example sensor configuration name: Livingroom Temperature @@ -64,7 +64,7 @@ Automations: If you're trying to setup filters for a sensor that has multiple outputs - for example a DHT22 which reports temperature *and* humidity - put the ``filters`` option into each sensor output like this: - .. code:: yaml + .. code-block:: yaml sensor: - platform: dht @@ -89,7 +89,7 @@ front-end a bit more clean. More sophisticated filters should be done with Home Assistant's `filter sensor `__. -.. code:: yaml +.. code-block:: yaml # Example filters: filters: @@ -183,7 +183,7 @@ unit internally, and I’m not planning on making converting between the two simple (😉), but you can use this filter to convert celsius values to fahrenheit. -.. code:: yaml +.. code-block:: yaml filters: - lambda: return x * (9.0/5.0) + 32.0; @@ -200,7 +200,7 @@ Therefore if you have an ``update_interval`` of 15 seconds, you will only see th every 3 and a half minutes or so. To disable the default filter and publish all raw values directly, put an empty ``filters:`` block in your configuration: -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: @@ -223,7 +223,7 @@ This automation will be triggered when a new value that has passed through all f is published. In :ref:`Lambdas ` you can get the value from the trigger with ``x``. -.. code:: yaml +.. code-block:: yaml sensor: - platform: dallas @@ -250,7 +250,7 @@ was outside the range. It will also trigger on startup if the first value receiv Define the range with ``above`` and ``below``. If only one of them is defined, the interval is half-open. So for example ``above: 5`` with no below would mean the range from 5 to positive infinity. -.. code:: yaml +.. code-block:: yaml sensor: - platform: dallas @@ -276,7 +276,7 @@ This automation will be triggered when a new value that has passed through all f is published. In :ref:`Lambdas ` you can get the value from the trigger with ``x``. -.. code:: yaml +.. code-block:: yaml sensor: - platform: dallas @@ -298,7 +298,7 @@ advanced stuff (see the full :doc:`API Reference ` for more i - ``publish_state()``: Manually cause the sensor to push out a value. It will then be processed by the sensor filters, and once done be published to MQTT. - .. code:: yaml + .. code-block:: cpp // Within lambda, push a value of 42.0 id(my_sensor).publish_state(42.0); @@ -306,7 +306,7 @@ advanced stuff (see the full :doc:`API Reference ` for more i - ``.state``: Retrieve the current value of the sensor that has passed through all sensor filters. Is ``NAN`` if no value has gotten through all filters yet. - .. code:: yaml + .. code-block:: cpp // For example, create a custom log message when a value is received: ESP_LOGI("main", "Value of my sensor: %f", id(my_sensor).state); @@ -314,7 +314,7 @@ advanced stuff (see the full :doc:`API Reference ` for more i - ``raw_state``: Retrieve the current value of the sensor that has not passed through any filters Is ``NAN`` if no value if no value has been pushed by the sensor itself yet. - .. code:: yaml + .. code-block:: cpp // For example, create a custom log message when a value is received: ESP_LOGI("main", "Raw Value of my sensor: %f", id(my_sensor).raw_state); diff --git a/esphomeyaml/components/sensor/max6675.rst b/esphomeyaml/components/sensor/max6675.rst index b8623f106..34dcf24f1 100644 --- a/esphomeyaml/components/sensor/max6675.rst +++ b/esphomeyaml/components/sensor/max6675.rst @@ -26,7 +26,7 @@ Connect ``GND`` to ``GND``, ``VCC`` to ``3.3V`` and the other three ``MISO`` (or :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry spi: diff --git a/esphomeyaml/components/sensor/mhz19.rst b/esphomeyaml/components/sensor/mhz19.rst index b91ebd98e..bd2a63745 100644 --- a/esphomeyaml/components/sensor/mhz19.rst +++ b/esphomeyaml/components/sensor/mhz19.rst @@ -22,7 +22,7 @@ to have an :ref:`UART bus ` in your configuration with the ``rx_pin`` conn MH-Z19 and the ``tx_pin`` connected to the RX Pin of the MH-Z19 (it's switched because the TX/RX labels are from the perspective of the MH-Z19). Additionally, you need to set the baud rate to 9600. -.. code:: yaml +.. code-block:: yaml # Example configuration entry uart: diff --git a/esphomeyaml/components/sensor/mpu6050.rst b/esphomeyaml/components/sensor/mpu6050.rst index 8a134a1c8..c616acee0 100644 --- a/esphomeyaml/components/sensor/mpu6050.rst +++ b/esphomeyaml/components/sensor/mpu6050.rst @@ -29,7 +29,7 @@ new feature. Supporting all possible use-cases would be quite hard. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/mqtt_subscribe.rst b/esphomeyaml/components/sensor/mqtt_subscribe.rst index 6eb8f6ca5..5696e1c72 100644 --- a/esphomeyaml/components/sensor/mqtt_subscribe.rst +++ b/esphomeyaml/components/sensor/mqtt_subscribe.rst @@ -14,7 +14,7 @@ Please note this integration only works with MQTT topics that have numeric data! a message that is not a number is published a warning will be shown. Please use the MQTT subscribe text sensor for importing arbitrary text into the esphomelib ecosystem. -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/ms5611.rst b/esphomeyaml/components/sensor/ms5611.rst index a9ec892cb..0212aebdd 100644 --- a/esphomeyaml/components/sensor/ms5611.rst +++ b/esphomeyaml/components/sensor/ms5611.rst @@ -7,7 +7,7 @@ MS5611 Atmospheric Pressure Sensor :keywords: MS5611 The ``ms5611`` sensor platform allows you to use your MS5611 atmospheric pressure sensors -(`datasheet `__, +(`datasheet `__, `hobbytronics`_) temperature and pressure sensors with esphomelib. The :ref:`I²C ` is required to be set up in your configuration for this sensor to work. @@ -23,7 +23,7 @@ required to be set up in your configuration for this sensor to work. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/pmsx003.rst b/esphomeyaml/components/sensor/pmsx003.rst index 7c7e72ae5..97ef469a7 100644 --- a/esphomeyaml/components/sensor/pmsx003.rst +++ b/esphomeyaml/components/sensor/pmsx003.rst @@ -3,7 +3,7 @@ PMSX003 Particulate Matter Sensor .. seo:: :description: Instructions for setting up PMSX003 Particulate matter sensors - :image: pmsx003.svg + :image: pmsx003.png .. warning:: @@ -25,7 +25,7 @@ value: - ``PMS5003T`` for PMS5003T. These support ``pm_2_5``, ``temperature`` and ``humidity``. - ``PMS5003ST`` for PMS5003ST. These support ``pm_2_5``, ``temperature``, ``humidity`` and ``formaldehyde``. -.. code:: yaml +.. code-block:: yaml # Example configuration entry uart: diff --git a/esphomeyaml/components/sensor/pulse_counter.rst b/esphomeyaml/components/sensor/pulse_counter.rst index 96b980e46..7e3ecfaa9 100644 --- a/esphomeyaml/components/sensor/pulse_counter.rst +++ b/esphomeyaml/components/sensor/pulse_counter.rst @@ -3,20 +3,20 @@ Pulse Counter Sensor .. seo:: :description: Instructions for setting up pulse counter sensors. - :image: pulse.svg + :image: pulse.png The pulse counter sensor allows you to count the number of pulses and the frequency of a signal on any pin. On the ESP32, this sensor is even highly accurate because it's using the hardware `pulse counter -peripheral `__ +peripheral `__ on the ESP32. .. figure:: images/pulse-counter.png :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: @@ -55,7 +55,7 @@ of “pulses/min”. You can change this by using :ref:`sensor-filters`. For example, if you’re using the pulse counter with a photodiode to count the light pulses on a power meter, you can do the following: -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: @@ -71,7 +71,7 @@ See Also - :ref:`sensor-filters` - :doc:`rotary_encoder` -- `esp-idf Pulse Counter API `__. +- `esp-idf Pulse Counter API `__. - :doc:`API Reference ` - `Edit this page on GitHub `__ diff --git a/esphomeyaml/components/sensor/rotary_encoder.rst b/esphomeyaml/components/sensor/rotary_encoder.rst index fef21eced..78db453ee 100644 --- a/esphomeyaml/components/sensor/rotary_encoder.rst +++ b/esphomeyaml/components/sensor/rotary_encoder.rst @@ -27,7 +27,7 @@ To use rotary encoders in esphomeyaml, first identify the two pins encoding th s These are often called ``CLK`` and ``DT`` as in above image. Note if the values this sensor outputs go in the wrong direction, you can just swap these two pins. -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: @@ -58,7 +58,7 @@ In order to not put too much stress on your network connection, you can leverage sensor filters. The following will only send out values if the last input value is at least 0.1s seconds old *or* if the new rotary encoder value has changed by 10 from the previous value. -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/sht3xd.rst b/esphomeyaml/components/sensor/sht3xd.rst index f4463c367..fff581ce1 100644 --- a/esphomeyaml/components/sensor/sht3xd.rst +++ b/esphomeyaml/components/sensor/sht3xd.rst @@ -17,7 +17,7 @@ required to be set up in your configuration for this sensor to work. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/tcs34725.rst b/esphomeyaml/components/sensor/tcs34725.rst index 55c92bd9c..9844f6bcc 100644 --- a/esphomeyaml/components/sensor/tcs34725.rst +++ b/esphomeyaml/components/sensor/tcs34725.rst @@ -23,7 +23,7 @@ required to be set up in your configuration for this sensor to work. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/template.rst b/esphomeyaml/components/sensor/template.rst index db60898a9..5bef8348d 100644 --- a/esphomeyaml/components/sensor/template.rst +++ b/esphomeyaml/components/sensor/template.rst @@ -3,12 +3,12 @@ Template Sensor .. seo:: :description: Instructions for setting up template sensors with esphomelib. - :image: description.svg + :image: description.png The ``template`` sensor platform allows you to create a sensor with templated values using :ref:`lambdas `. -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: @@ -45,7 +45,7 @@ Configuration variables: You can use the ``publish_state()`` method to set the value of a template sensor from other automations: - .. code:: cpp + .. code-block:: cpp id(my_sensor).publish_state(42.0); diff --git a/esphomeyaml/components/sensor/total_daily_energy.rst b/esphomeyaml/components/sensor/total_daily_energy.rst index 7e7a16442..aee7c9a9e 100644 --- a/esphomeyaml/components/sensor/total_daily_energy.rst +++ b/esphomeyaml/components/sensor/total_daily_energy.rst @@ -3,7 +3,7 @@ Total Daily Energy Sensor .. seo:: :description: Instructions for setting up sensors that track the total daily energy usage per day and accumulate the power usage. - :image: sigma.svg + :image: sigma.png The ``total_daily_energy`` sensor is a helper sensor that can use the energy value of other sensors like the :doc:`HLW8012 `, :doc:`CSE7766 `, etc and integrate @@ -12,7 +12,7 @@ it over time. So this component allows you to convert readings in ``W`` or ``kW`` to readings of the total daily energy usage in ``Wh`` or ``kWh``. -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/tsl2561.rst b/esphomeyaml/components/sensor/tsl2561.rst index 11246a748..e8c3d07fe 100644 --- a/esphomeyaml/components/sensor/tsl2561.rst +++ b/esphomeyaml/components/sensor/tsl2561.rst @@ -24,7 +24,7 @@ your configuration for this sensor to work. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: @@ -57,7 +57,7 @@ See Also - :ref:`sensor-filters` - :doc:`bh1750` - :doc:`adc` -- `SparkFun TSL2561 Arduino Library `__ by `Sparkfun `__ +- `SparkFun TSL2561 Arduino Library `__ by `Sparkfun `__ - :doc:`API Reference ` - `Edit this page on GitHub `__ diff --git a/esphomeyaml/components/sensor/ultrasonic.rst b/esphomeyaml/components/sensor/ultrasonic.rst index 5e543bd41..2eaf346bf 100644 --- a/esphomeyaml/components/sensor/ultrasonic.rst +++ b/esphomeyaml/components/sensor/ultrasonic.rst @@ -32,7 +32,7 @@ set too high. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: @@ -70,7 +70,7 @@ option kicks in. To remove ``NAN`` values from the sensor stream, use the ``filter_nan`` :ref:`sensor filter `: -.. code:: yaml +.. code-block:: yaml sensor: - platform: ultrasonic diff --git a/esphomeyaml/components/sensor/uptime.rst b/esphomeyaml/components/sensor/uptime.rst index 0fd7a4b82..74205f39b 100644 --- a/esphomeyaml/components/sensor/uptime.rst +++ b/esphomeyaml/components/sensor/uptime.rst @@ -3,12 +3,12 @@ Uptime Sensor .. seo:: :description: Instructions for setting up a sensor that tracks the uptime of the ESP. - :image: timer.svg + :image: timer.png The ``uptime`` sensor allows you to track the time the ESP has stayed up for in seconds. Time rollovers are automatically handled. -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/wifi_signal.rst b/esphomeyaml/components/sensor/wifi_signal.rst index f4ba8e0be..4f9ecb006 100644 --- a/esphomeyaml/components/sensor/wifi_signal.rst +++ b/esphomeyaml/components/sensor/wifi_signal.rst @@ -3,7 +3,7 @@ WiFi Signal Sensor .. seo:: :description: Instructions for setting up WiFi signal sensors that track the RSSI connection strength value to the network. - :image: network-wifi.svg + :image: network-wifi.png The ``wifi_signal`` sensor platform allows you to read the signal strength of the currently connected :doc:`WiFi Access Point `. @@ -15,7 +15,7 @@ measured in decibels. These values are always negative and the closer they are t :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry sensor: diff --git a/esphomeyaml/components/sensor/xiaomi_miflora.rst b/esphomeyaml/components/sensor/xiaomi_miflora.rst index a6e41257d..228c8b6a7 100644 --- a/esphomeyaml/components/sensor/xiaomi_miflora.rst +++ b/esphomeyaml/components/sensor/xiaomi_miflora.rst @@ -12,7 +12,7 @@ temperature, humidity and optionally the battery level of the MiFlora device eve sends out a BLE broadcast. Note that contrary to other implementations, esphomelib can track as many MiFlora devices at once as you want. -.. code:: yaml +.. code-block:: yaml # Example configuration entry esp32_ble_tracker: @@ -72,7 +72,7 @@ Setting Up Devices To set up Xiaomi MiFlora devices you first need to find their MAC Address so that esphomelib can identify them. So first, create a simple configuration without any ``xiaomi_miflora`` entries like so: -.. code:: yaml +.. code-block:: yaml esp32_ble_tracker: diff --git a/esphomeyaml/components/sensor/xiaomi_mijia.rst b/esphomeyaml/components/sensor/xiaomi_mijia.rst index 6488e0a8f..5520da32f 100644 --- a/esphomeyaml/components/sensor/xiaomi_mijia.rst +++ b/esphomeyaml/components/sensor/xiaomi_mijia.rst @@ -22,7 +22,7 @@ MiJia devices at once as you want. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry esp32_ble_tracker: @@ -66,7 +66,7 @@ Setting Up Devices To set up Xiaomi MiJia devices you first need to find their MAC Address so that esphomelib can identify them. So first, create a simple configuration without any ``xiaomi_mijia`` entries like so: -.. code:: yaml +.. code-block:: yaml esp32_ble_tracker: diff --git a/esphomeyaml/components/spi.rst b/esphomeyaml/components/spi.rst index 3c8ef1b2a..f387cae23 100644 --- a/esphomeyaml/components/spi.rst +++ b/esphomeyaml/components/spi.rst @@ -5,7 +5,7 @@ SPI Bus .. seo:: :description: Instructions for setting up an SPI bus in esphomelib - :image: spi.svg + :image: spi.png :keywords: SPI SPI is a very common high-speed protocol for a lot of devices. The SPI bus usually consists of 4 wires: @@ -26,7 +26,7 @@ use for the functions described above. The **CS** pins are then individually man component also accepts a list of buses if you want to have multiple SPI buses with your ESP (though this should rarely be necessary, as the SPI bus can be shared by the devices). -.. code:: yaml +.. code-block:: yaml # Example configuration entry spi: diff --git a/esphomeyaml/components/status_led.rst b/esphomeyaml/components/status_led.rst index 78eecd229..cb8d70030 100644 --- a/esphomeyaml/components/status_led.rst +++ b/esphomeyaml/components/status_led.rst @@ -3,7 +3,7 @@ Status LED .. seo:: :description: Instructions for setting up status LEDs in esphomelib to monitor the status of an ESP. - :image: led-on.svg + :image: led-on.png The ``status_led`` hooks into all esphomelib components and can indicate the status of the device. Specifically, it will: @@ -15,7 +15,7 @@ the device. Specifically, it will: recover from the error and continue with all other operations. - Stay off otherwise. -.. code:: yaml +.. code-block:: yaml # Example configuration entry status_led: @@ -33,7 +33,7 @@ Configuration variables: If your LED is in an active-LOW mode (when it's on if the output is enabled), use the ``inverted`` option of the :ref:`Pin Schema `: - .. code:: yaml + .. code-block:: yaml status_led: pin: diff --git a/esphomeyaml/components/stepper/index.rst b/esphomeyaml/components/stepper/index.rst index 30270acce..1be0b71f2 100644 --- a/esphomeyaml/components/stepper/index.rst +++ b/esphomeyaml/components/stepper/index.rst @@ -3,7 +3,7 @@ Stepper Component .. seo:: :description: Instructions for setting up stepper motor drivers in esphomelib - :image: folder-open.svg + :image: folder-open.png :keywords: stepper motor, stepper driver, a4988 The ``stepper`` component allows you to use stepper motors with esphomelib. @@ -11,7 +11,7 @@ Currently only the A4988 stepper driver (`datasheet `__) is supported. -.. code:: yaml +.. code-block:: yaml # Example configuration entry stepper: @@ -57,7 +57,7 @@ Configuration variables: If the stepper is driving in the wrong direction, you can invert the ``dir_pin``: - .. code:: yaml + .. code-block:: yaml stepper: - platform: a4988 @@ -75,7 +75,7 @@ Configuration variables: To use your stepper motor in :ref:`automations ` or templates, you can use this action to set the target position (in steps). The stepper will always run towards the target position and stop once it has reached the target. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -102,7 +102,7 @@ Configuration options: This action can also be expressed as a :ref:`lambda `: - .. code:: cpp + .. code-block:: cpp id(my_stepper).set_target(250); @@ -122,7 +122,7 @@ that reporting the position can create unexpected moves of the stepper. For exam current position is at 1000 steps and you "report" a position of 0, the stepper will move 1000 steps forward to match the target again. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -153,7 +153,7 @@ Configuration options: This action can also be expressed as a :ref:`lambda `: - .. code:: cpp + .. code-block:: cpp id(my_stepper).report_position(250); diff --git a/esphomeyaml/components/switch/gpio.rst b/esphomeyaml/components/switch/gpio.rst index 9de35392a..3c4ac676c 100644 --- a/esphomeyaml/components/switch/gpio.rst +++ b/esphomeyaml/components/switch/gpio.rst @@ -3,7 +3,7 @@ GPIO Switch .. seo:: :description: Instructions for setting up GPIO pin switches in esphomelib that control GPIO outputs. - :image: pin.svg + :image: pin.png The ``gpio`` switch platform allows you to use any pin on your node as a switch. You can for example hook up a relay to a GPIO pin and use it @@ -13,7 +13,7 @@ through this platform. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry switch: diff --git a/esphomeyaml/components/switch/index.rst b/esphomeyaml/components/switch/index.rst index 171fec568..7f989f7f5 100644 --- a/esphomeyaml/components/switch/index.rst +++ b/esphomeyaml/components/switch/index.rst @@ -3,7 +3,7 @@ Switch Component .. seo:: :description: Instructions for setting up generic switches in esphomelib. - :image: folder-open.svg + :image: folder-open.png The ``switch`` domain includes all platforms that should show up like a switch and can only be turned ON or OFF. @@ -13,7 +13,7 @@ switch and can only be turned ON or OFF. Base Switch Configuration ------------------------- -.. code:: yaml +.. code-block:: yaml switch: - platform: ... @@ -37,7 +37,7 @@ Configuration variables: This action toggles a switch with the given ID when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -50,7 +50,7 @@ This action toggles a switch with the given ID when executed. This action turns a switch with the given ID on when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -63,7 +63,7 @@ This action turns a switch with the given ID on when executed. This action turns a switch with the given ID off when executed. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -78,7 +78,7 @@ advanced stuff (see the full :doc:`API Reference ` for more in - ``publish_state()``: Manually cause the switch to publish a new state and store it internally. If it's different from the last internal state, it's additionally published to the frontend. - .. code:: yaml + .. code-block:: yaml // Within lambda, make the switch report a specific state id(my_switch).publish_state(false); @@ -86,7 +86,7 @@ advanced stuff (see the full :doc:`API Reference ` for more in - ``state``: Retrieve the current state of the switch. - .. code:: yaml + .. code-block:: yaml // Within lambda, get the switch state and conditionally do something if (id(my_switch).state) { @@ -99,7 +99,7 @@ advanced stuff (see the full :doc:`API Reference ` for more in Similar to the ``switch.turn_on`` and ``switch.turn_off`` actions, but can be used in complex lambda expressions. - .. code:: yaml + .. code-block:: yaml id(my_switch).write_state(false); id(my_switch).write_state(true); diff --git a/esphomeyaml/components/switch/output.rst b/esphomeyaml/components/switch/output.rst index 37019dc9e..f56759d3a 100644 --- a/esphomeyaml/components/switch/output.rst +++ b/esphomeyaml/components/switch/output.rst @@ -3,7 +3,7 @@ Generic Output Switch .. seo:: :description: Instructions for setting up generic output switches in esphomelib that control an output component. - :image: upload.svg + :image: upload.png The ``output`` switch platform allows you to use any output component as a switch. @@ -11,7 +11,7 @@ The ``output`` switch platform allows you to use any output component as a switc :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry output: diff --git a/esphomeyaml/components/switch/remote_transmitter.rst b/esphomeyaml/components/switch/remote_transmitter.rst index e69196462..fea0bbfac 100644 --- a/esphomeyaml/components/switch/remote_transmitter.rst +++ b/esphomeyaml/components/switch/remote_transmitter.rst @@ -3,7 +3,7 @@ Remote Transmitter Switch .. seo:: :description: Instructions for setting up switches that send out pre-defined sequences of IR or RF signals - :image: remote.svg + :image: remote.png :keywords: Infrared, IR, RF, Remote, TX The ``remote_transmitter`` switch platform allows you to create switches @@ -17,7 +17,7 @@ Use cases include, but are not limited to, infrared remotes, 433MHz signals and :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry remote_transmitter: @@ -53,7 +53,7 @@ Configuration variables: For the Sonoff RF Bridge you can use `this hack `__ created by the Github user wildwiz. Then use this configuration for the remote receiver/transmitter hubs: - .. code:: yaml + .. code-block:: yaml remote_receiver: pin: 4 @@ -72,7 +72,7 @@ Remote Codes Supported remote codes: -.. code:: yaml +.. code-block:: yaml switch: - platform: remote_transmitter @@ -198,7 +198,7 @@ Each remote transmitter uses a different protocol to send its information. So to remote you will first need to "learn" these codes. You will first need to hook up a receiver and sniff the codes using the :doc:`remote receiver component ` like this: -.. code:: yaml +.. code-block:: yaml remote_receiver: pin: GPIO34 @@ -223,7 +223,7 @@ value denotes the output being HIGH for the specified number of microseconds. Now you only need to set up the remote transmitter (which well *send* the code) like this: -.. code:: yaml +.. code-block:: yaml remote_transmitter: pin: GPIO23 @@ -232,7 +232,7 @@ Now you only need to set up the remote transmitter (which well *send* the code) And lastly, we need to set up the switch that, when turned on, will send our pre-defined remote code: -.. code:: yaml +.. code-block:: yaml switch: - platform: remote_transmitter @@ -260,7 +260,7 @@ remote protocol. If you have RF code dumping enabled for the receiver, you will Like before with raw codes, you can then use this code to create switches: -.. code:: yaml +.. code-block:: yaml switch: - platform: remote_transmitter @@ -273,7 +273,7 @@ Alternatively, you can use the information on `this page ` when triggered. -.. code:: yaml +.. code-block:: yaml # Example configuration entry uart: diff --git a/esphomeyaml/components/text_sensor/index.rst b/esphomeyaml/components/text_sensor/index.rst index 10005d2c1..8d4e9e2e8 100644 --- a/esphomeyaml/components/text_sensor/index.rst +++ b/esphomeyaml/components/text_sensor/index.rst @@ -3,7 +3,7 @@ Text Sensor Component .. seo:: :description: Instructions for setting up text sensors that represent their state as a string of text. - :image: folder-open.svg + :image: folder-open.png Text sensors are a lot like normal :doc:`sensors `. But where the "normal" sensors only represent sensors that output **numbers**, this @@ -14,7 +14,7 @@ component can represent any *text*. Base Text Sensor Configuration ------------------------------ -.. code:: yaml +.. code-block:: yaml # Example sensor configuration name: Livingroom Temperature @@ -46,7 +46,7 @@ You can access the most recent state of the sensor in :ref:`lambdas ` you can get the value from the trigger with ``x``. -.. code:: yaml +.. code-block:: yaml text_sensor: - platform: version @@ -66,14 +66,14 @@ advanced stuff (see the full :doc:`API Reference ` for more i - ``publish_state()``: Manually cause the sensor to push out a value. - .. code:: yaml + .. code-block:: cpp // Within lambda, push a value of "Hello World" id(my_sensor).publish_state("Hello World"); - ``.state``: Retrieve the current value of the sensor as an ``std::string`` object. - .. code:: yaml + .. code-block:: cpp // For example, create a custom log message when a value is received: std::string val = id(my_sensor).state; diff --git a/esphomeyaml/components/text_sensor/mqtt_subscribe.rst b/esphomeyaml/components/text_sensor/mqtt_subscribe.rst index e94b1ab8b..edf7d24ea 100644 --- a/esphomeyaml/components/text_sensor/mqtt_subscribe.rst +++ b/esphomeyaml/components/text_sensor/mqtt_subscribe.rst @@ -10,7 +10,7 @@ The ``mqtt_subscribe`` text sensor platform allows you to get external data into The sensor will subscribe to messages on the given MQTT topic and save the most recent value in its ``id(mysensor).value``. -.. code:: yaml +.. code-block:: yaml # Example configuration entry text_sensor: @@ -35,7 +35,7 @@ This integration is especially useful for displays, to show external data on the Please note you have to use the ``.c_str()`` method on the ``.state`` object together with the ``%s`` format to use it in ``printf`` expressions. -.. code:: yaml +.. code-block:: yaml # Example configuration entry text_sensor: diff --git a/esphomeyaml/components/text_sensor/template.rst b/esphomeyaml/components/text_sensor/template.rst index c24bd19ad..dd1c8cc5e 100644 --- a/esphomeyaml/components/text_sensor/template.rst +++ b/esphomeyaml/components/text_sensor/template.rst @@ -3,12 +3,12 @@ Template Text Sensor .. seo:: :description: Instructions for setting up template text sensors in esphomelib - :image: description.svg + :image: description.png The ``template`` text sensor platform allows you to create a text sensor with templated values using :ref:`lambdas `. -.. code:: yaml +.. code-block:: yaml # Example configuration entry text_sensor: diff --git a/esphomeyaml/components/text_sensor/version.rst b/esphomeyaml/components/text_sensor/version.rst index b6e6479b7..5440f0b3f 100644 --- a/esphomeyaml/components/text_sensor/version.rst +++ b/esphomeyaml/components/text_sensor/version.rst @@ -3,7 +3,7 @@ Version Text Sensor .. seo:: :description: Instructions for setting up version text sensors. - :image: new-box.svg + :image: new-box.png The ``version`` text sensor platform exposes the esphomelib version the firmware was compiled against as a text sensor. @@ -12,7 +12,7 @@ was compiled against as a text sensor. :align: center :width: 80.0% -.. code:: yaml +.. code-block:: yaml # Example configuration entry text_sensor: diff --git a/esphomeyaml/components/time.rst b/esphomeyaml/components/time.rst index 0cdfa8859..7b8ea1dd5 100644 --- a/esphomeyaml/components/time.rst +++ b/esphomeyaml/components/time.rst @@ -5,35 +5,31 @@ Time .. seo:: :description: Instructions for setting up real time clock sources in esphomelib like network based time. - :image: clock-outline.svg + :image: clock-outline.png :keywords: NTP, SNTP, RTC The ``time`` component allows you to set up real time clock time sources for esphomelib. You can then get the current time in :ref:`lambdas `. Currently only sntp (internet-based) time is supported. -.. code:: yaml +.. code-block:: yaml # Example configuration entry time: - platform: sntp id: sntp_time - servers: - - 0.pool.ntp.org - - 1.pool.ntp.org - - 2.pool.ntp.org Configuration variables: ------------------------ - **id** (**Required**, :ref:`config-id`): Specify the ID of the time for use in lambdas. -- **servers** (*Optional*, list of strings): Choose up to 3 NTP servers that are used for the clock source. - Defaults to ``0.pool.ntp.org``, ``1.pool.ntp.org`` and ``2.pool.ntp.org`` - **timezone** (*Optional*, string): Manually tell esphomelib what timezone to use with `this format `__ (warning: the format is quite complicated). esphomeyaml tries to automatically infer the timezone string based on the timezone of the computer that is running esphomeyaml, but this might not always be accurate. +- **servers** (*Optional*, list of strings): Choose up to 3 NTP servers that are used for the clock source. + Defaults to ``0.pool.ntp.org``, ``1.pool.ntp.org`` and ``2.pool.ntp.org`` - **on_time** (*Optional*, :ref:`Automation `): Automation to run at specific intervals using a cron-like syntax. See :ref:`time-on_time`. @@ -49,7 +45,7 @@ Use In Lambdas To get the current local time with the timezone applied in :ref:`lambdas `, just call the ``.now()`` method like so: -.. code:: cpp +.. code-block:: cpp auto time = id(sntp_time).now(); @@ -106,7 +102,7 @@ The second way to use the time object is to directly transform it into a string This is directly done using C's `strftime `__ function which allows for a lot of flexibility. -.. code:: yaml +.. code-block:: cpp # For example, in a display object it.strftime(0, 0, id(font), "%Y-%m-%d %H:%M", id(time).now()); @@ -183,7 +179,7 @@ keys as seen below or using a cron expression like ``* /5 * * * *``. Basically, the automation engine looks at your configured time schedule every second and evaluates if the automation should run. -.. code:: yaml +.. code-block:: yaml time: - platform: sntp @@ -231,20 +227,20 @@ Configuration variables: In the ``seconds:``, ``minutes:``, ... fields you can use the following operators: -- .. code:: yaml +- .. code-block:: yaml seconds: 0 An integer like ``0`` or ``30`` will make the automation only trigger if the current second is **exactly** 0 or 30, respectively. -- .. code:: yaml +- .. code-block:: yaml seconds: 0,30,45 You can combine multiple expressions with the ``,`` operator. This operator makes it so that if either one of the expressions separated by a comma holds true, the automation will trigger. For example ``0,30,45`` will trigger if the current second is either ``0`` or ``30`` or ``45``. -- .. code:: yaml +- .. code-block:: yaml days_of_week: 2-6 # same as @@ -256,7 +252,7 @@ In the ``seconds:``, ``minutes:``, ... fields you can use the following operator The ``-`` (hyphen) operator can be used to create a range of values and is shorthand for listing all values with the ``,`` operator. -- .. code:: yaml +- .. code-block:: yaml # every 5 minutes seconds: 0 @@ -270,11 +266,11 @@ In the ``seconds:``, ``minutes:``, ... fields you can use the following operator automation trigger only when the minute of the hour is 0, or 5, 10, 15, ... The value in front of the ``/`` specifies the offset with which the step is applied. -- .. code:: yaml +- .. code-block:: yaml # Every minute seconds: 0 - minutes: * + minutes: '*' Lastly, the ``*`` operator matches every number. In the example above, ``*`` could for example be substituted with ``0-59``. @@ -285,7 +281,7 @@ In the ``seconds:``, ``minutes:``, ... fields you can use the following operator Please note the following automation would trigger for each second in the minutes 0,5,10,15 and not once per 5 minutes as the seconds variable is not set: - .. code:: yaml + .. code-block:: yaml time: - platform: sntp diff --git a/esphomeyaml/components/uart.rst b/esphomeyaml/components/uart.rst index 796104f86..5b78e14c8 100644 --- a/esphomeyaml/components/uart.rst +++ b/esphomeyaml/components/uart.rst @@ -5,7 +5,7 @@ UART Bus .. seo:: :description: Instructions for setting up a UART serial bus on ESPs - :image: uart.svg + :image: uart.png :keywords: UART, serial bus UART is a common serial protocol for a lot of devices. For example, when uploading a binary to your ESP @@ -32,7 +32,7 @@ In some cases only **TX** or **RX** exists as the device at the other end only a ones used for logging. Therefore the UART data on the ESP8266 can have occasional data glitches especially with higher baud rates.. -.. code:: yaml +.. code-block:: yaml # Example configuration entry uart: diff --git a/esphomeyaml/components/web_server.rst b/esphomeyaml/components/web_server.rst index 768c36084..306d7ce80 100644 --- a/esphomeyaml/components/web_server.rst +++ b/esphomeyaml/components/web_server.rst @@ -3,7 +3,7 @@ Web Server Component .. seo:: :description: Instructions for setting up a web server in esphomelib. - :image: http.svg + :image: http.png :keywords: web server, http, REST API The ``web_server`` component creates a simple web server on the node that can be accessed @@ -24,7 +24,7 @@ interface are hosted by esphomelib.com. If you want to use your own service, use Example web server frontend. -.. code:: yaml +.. code-block:: yaml # Example configuration entry web_server: diff --git a/esphomeyaml/components/wifi.rst b/esphomeyaml/components/wifi.rst index 59e5b4ab8..40f71b03c 100644 --- a/esphomeyaml/components/wifi.rst +++ b/esphomeyaml/components/wifi.rst @@ -3,7 +3,7 @@ WiFi Component .. seo:: :description: Instructions for setting up the WiFi configuration for your ESP node in esphomelib. - :image: network-wifi.svg + :image: network-wifi.png :keywords: WiFi, WLAN, ESP8266, ESP32 This core esphomelib component sets up WiFi connections to access points @@ -13,7 +13,7 @@ will fail in the config validation stage. It’s recommended to provide a static IP for your node, as it can dramatically improve connection times. -.. code:: yaml +.. code-block:: yaml # Example configuration entry wifi: @@ -85,7 +85,7 @@ to the ESP. This way, the ESP doesn't need to go through the slow DHCP process. You can do so with the ``manual_ip:`` option in the WiFi configuration. -.. code:: yaml +.. code-block:: yaml wifi: # ... @@ -121,7 +121,7 @@ please also try ``light``. - ``LIGHT`` - ``HIGH`` (most power saving) -.. code:: yaml +.. code-block:: yaml wifi: # ... diff --git a/esphomeyaml/cookbook/bruh.rst b/esphomeyaml/cookbook/bruh.rst index 775bab2eb..f0f3075cd 100644 --- a/esphomeyaml/cookbook/bruh.rst +++ b/esphomeyaml/cookbook/bruh.rst @@ -16,7 +16,7 @@ stuff used by the Multisensor 🎉 Thank you very much to `@jackjohnsonuk `__ for providing this configuration file 😀 -.. code:: yaml +.. code-block:: yaml esphomeyaml: name: diff --git a/esphomeyaml/cookbook/dual-r2-cover.rst b/esphomeyaml/cookbook/dual-r2-cover.rst index 4a21c6921..1f2f5517f 100644 --- a/esphomeyaml/cookbook/dual-r2-cover.rst +++ b/esphomeyaml/cookbook/dual-r2-cover.rst @@ -28,7 +28,7 @@ for some motors. feature is implemented using asynchronous automations. So every time a open/close command is sent a delayed relay off command is added and old ones are not removed. -.. code:: yaml +.. code-block:: yaml esphomeyaml: name: cover diff --git a/esphomeyaml/cookbook/garage-door.rst b/esphomeyaml/cookbook/garage-door.rst index 98f0b4596..ba814d674 100644 --- a/esphomeyaml/cookbook/garage-door.rst +++ b/esphomeyaml/cookbook/garage-door.rst @@ -3,7 +3,7 @@ Simple Garage Door .. seo:: :description: Instructions for setting up a simple garage door in esphomelib. - :image: window-open.svg + :image: window-open.png The following is a possible configuration file for garage doors that are controlled by two relays: One for opening and another one for closing the garage door. When either one of them is turned on @@ -11,7 +11,7 @@ for a short period of time, the close/open action begins. -.. code:: yaml +.. code-block:: yaml switch: - platform: gpio diff --git a/esphomeyaml/cookbook/pir.rst b/esphomeyaml/cookbook/pir.rst index 186dceb4e..5c873a3ce 100644 --- a/esphomeyaml/cookbook/pir.rst +++ b/esphomeyaml/cookbook/pir.rst @@ -45,7 +45,7 @@ To configure esphomeyaml for use with the PIR sensor, use a if a pin is pulled HIGH/LOW and reports those values to Home Assistant. Optionally also set a ``device_class`` so that Home Assistant uses a nice icon for the binary sensor. -.. code:: yaml +.. code-block:: yaml binary_sensor: - platform: gpio diff --git a/esphomeyaml/cookbook/power_meter.rst b/esphomeyaml/cookbook/power_meter.rst index 31ef0904e..77794c429 100644 --- a/esphomeyaml/cookbook/power_meter.rst +++ b/esphomeyaml/cookbook/power_meter.rst @@ -27,7 +27,7 @@ And... that should already be it :) For esphomelib, you can then use the :doc:`pulse counter sensor ` using below configuration: -.. code:: yaml +.. code-block:: yaml sensor: - platform: pulse_counter @@ -51,7 +51,7 @@ power meter, tell them about esphomelib 😉 a single power meter tick can result in many pulses being counted. This effect is especially big on ESP8266s. If you're experiencing this, try enabling the ``internal_filter:`` filter option: - .. code:: yaml + .. code-block:: yaml sensor: - platform: pulse_counter diff --git a/esphomeyaml/cookbook/relay.rst b/esphomeyaml/cookbook/relay.rst index efd828f05..40f060953 100644 --- a/esphomeyaml/cookbook/relay.rst +++ b/esphomeyaml/cookbook/relay.rst @@ -32,7 +32,7 @@ when the input turns off, ``NC`` is connected to ``COM``. To use a relay with esphomelib, use a :doc:`GPIO Switch `. -.. code:: yaml +.. code-block:: yaml switch: - platform: gpio diff --git a/esphomeyaml/cookbook/temt6000.rst b/esphomeyaml/cookbook/temt6000.rst index b904d34f5..197880ba7 100644 --- a/esphomeyaml/cookbook/temt6000.rst +++ b/esphomeyaml/cookbook/temt6000.rst @@ -21,7 +21,7 @@ To get the brightness the sensor measures, we then simply have to measure the vo on the ``SIG`` (also called ``OUT``) pin using the :doc:`/esphomeyaml/components/sensor/adc` and convert those voltage measurements to illuminance values in lux using a formula: -.. code:: yaml +.. code-block:: yaml sensor: - platform: adc diff --git a/esphomeyaml/devices/esp32.rst b/esphomeyaml/devices/esp32.rst index 4c08c0fba..2f791b940 100644 --- a/esphomeyaml/devices/esp32.rst +++ b/esphomeyaml/devices/esp32.rst @@ -3,14 +3,14 @@ Generic ESP32 .. seo:: :description: Information about how to use generic ESP32 boards in esphomelib. - :image: esp32.svg + :image: esp32.png All ESP32-based devices are supported by esphomeyaml. Simply select ``ESP32`` when the esphomeyaml wizard asks you for your platform and choose a board type from `this link `__ when the wizard asks you for the board type. -.. code:: yaml +.. code-block:: yaml # Example configuration entry esphomeyaml: @@ -33,7 +33,7 @@ Some notes about the pins on the ESP32: the :doc:`touch pad binary sensor ` like some other pins. -.. code:: yaml +.. code-block:: yaml # Example configuration entry esphomeyaml: diff --git a/esphomeyaml/devices/esp8266.rst b/esphomeyaml/devices/esp8266.rst index 44c269ffd..933cfca4d 100644 --- a/esphomeyaml/devices/esp8266.rst +++ b/esphomeyaml/devices/esp8266.rst @@ -3,7 +3,7 @@ Generic ESP8266 .. seo:: :description: Instructions for using generic ESP8266s with esphomelib. - :image: esp8266.svg + :image: esp8266.png :keywords: ESP8266 All ESP8266-based devices are supported by esphomeyaml. Simply select ``ESP8266`` when @@ -12,7 +12,7 @@ from `this link ` to ``esp01_1m`` and set ``board_flash_mode`` to ``dout``. -.. code:: yaml +.. code-block:: yaml esphomeyaml: name: diff --git a/esphomeyaml/devices/sonoff_4ch.rst b/esphomeyaml/devices/sonoff_4ch.rst index 0a30b7170..6c0e189a0 100644 --- a/esphomeyaml/devices/sonoff_4ch.rst +++ b/esphomeyaml/devices/sonoff_4ch.rst @@ -127,7 +127,7 @@ the Sonoff 4CH uses the ``dout`` SPI flash chip mode. But, as some users of othe said that other flash modes can brick the device, it's always good to specify it explicitly. -.. code:: yaml +.. code-block:: yaml esphomeyaml: name: @@ -173,7 +173,7 @@ another 2-4 seconds. The 4CH should now be in a flash mode and should not blink Now you can finally run the upload command: -.. code:: bash +.. code-block:: bash esphomeyaml sonoff_4ch.yaml run @@ -229,7 +229,7 @@ of the basic functions. ``GPIO3`` ``TX`` pin (for external sensors) ======================================== ========================================= -.. code:: yaml +.. code-block:: yaml esphomeyaml: name: diff --git a/esphomeyaml/devices/sonoff_basic.rst b/esphomeyaml/devices/sonoff_basic.rst index 3f5b56610..4ad1e8cf5 100644 --- a/esphomeyaml/devices/sonoff_basic.rst +++ b/esphomeyaml/devices/sonoff_basic.rst @@ -61,7 +61,7 @@ exposes all of the basic functions. ``GPIO17`` Analog Input ================================================== ================================================== -.. code:: yaml +.. code-block:: yaml esphomeyaml: name: @@ -120,7 +120,7 @@ pre-compile the firmware. Or run the upload command if your device is connected to the serial interface: -.. code:: bash +.. code-block:: bash esphomeyaml sonoff_basic.yaml run diff --git a/esphomeyaml/devices/sonoff_s20.rst b/esphomeyaml/devices/sonoff_s20.rst index 349b7481c..17fcf2333 100644 --- a/esphomeyaml/devices/sonoff_s20.rst +++ b/esphomeyaml/devices/sonoff_s20.rst @@ -128,7 +128,7 @@ the Sonoff S20 uses the ``dout`` SPI flash chip mode. But, as some users of othe said that other flash modes can brick the device, it's always good to specify it explicitly. -.. code:: yaml +.. code-block:: yaml esphomeyaml: name: @@ -169,7 +169,7 @@ The S20 should now be in a flash mode and should not blink with any LED. Now you can finally run the upload command: -.. code:: bash +.. code-block:: bash esphomeyaml sonoff_s20.yaml run @@ -213,7 +213,7 @@ of the basic functions. ``GPIO3`` ``TX`` pin (for external sensors) ======================================== ======================================== -.. code:: yaml +.. code-block:: yaml esphomeyaml: name: @@ -274,7 +274,7 @@ into a :doc:`monochromatic light `. And if you want the thing that's connected through the output of the S20 to appear as a light in Home Assistant, replace the last part with this: -.. code:: yaml +.. code-block:: yaml switch: - platform: restart diff --git a/esphomeyaml/guides/automations.rst b/esphomeyaml/guides/automations.rst index 75a2f20bc..c6dbeda8f 100644 --- a/esphomeyaml/guides/automations.rst +++ b/esphomeyaml/guides/automations.rst @@ -5,7 +5,7 @@ Automations And Templates .. seo:: :description: Getting started guide for automations in esphomelib. - :image: auto-fix.svg + :image: auto-fix.png Automations and templates are two very powerful concepts of esphomelib/yaml. Automations allow you to perform actions under certain conditions and templates are a way to easily @@ -14,7 +14,7 @@ API. Let's begin with an example to explain these concepts. Suppose you have this configuration file: -.. code:: yaml +.. code-block:: yaml switch: - platform: gpio @@ -42,7 +42,7 @@ hopefully a bit easier to read and understand than Home Assistant's. For example, this configuration would achieve your desired behavior: -.. code:: yaml +.. code-block:: yaml switch: - platform: gpio @@ -62,7 +62,7 @@ For example, this configuration would achieve your desired behavior: Woah, hold on there. Please explain what's going on here! Sure :) Let's step through what's happening here. -.. code:: yaml +.. code-block:: yaml switch: - platform: gpio @@ -72,7 +72,7 @@ Woah, hold on there. Please explain what's going on here! Sure :) Let's step thr First, we have to give the dehumidifier an :ref:`config-id` so that we can later use it inside our awesome automation. -.. code:: yaml +.. code-block:: yaml binary_sensor: - platform: gpio @@ -85,7 +85,7 @@ follows what you would call these events on mouse buttons. A *press* happens whe There are also other triggers like ``on_release``, ``on_click`` or ``on_double_click`` available. -.. code:: yaml +.. code-block:: yaml # ... on_press: @@ -102,7 +102,7 @@ Within this block, you can define several "actions". For example, ``switch.toggl action. Each action is separated by a dash and multiple actions can be executed in series by just adding another ``-`` like so: -.. code:: yaml +.. code-block:: yaml # ... on_press: @@ -114,7 +114,7 @@ like so: With this automation, a press on the push button would cause the dehumidifier to turn on/off for 2 seconds, and then cycle back to its original state. Similarly you can have a single trigger with multiple automations: -.. code:: yaml +.. code-block:: yaml # ... on_press: @@ -133,7 +133,7 @@ cycle back to its original state. Similarly you can have a single trigger with m As a last example, let's make our dehumidifier smart: Let's make it turn on automatically when the humidity a sensor reports is above 65% and make it turn off again when it reaches 50% -.. code:: yaml +.. code-block:: yaml sensor: - platform: dht @@ -166,7 +166,7 @@ With templates inside esphomelib, you can do almost *everything*. If for example automation if a certain complex formula evaluates to true, you can do that with templates. Let's look at an example first: -.. code:: yaml +.. code-block:: yaml binary_sensor: - platform: gpio @@ -221,7 +221,7 @@ we're retrieving the current state of the end stop using ``.state`` and using it variables like so. In this example the variable ``num_executions`` is incremented by one each time the lambda is executed and the current value is logged. - .. code:: yaml + .. code-block:: yaml lambda: |- static int num_executions = 0; @@ -236,7 +236,7 @@ Bonus: Templating Actions Another feature of esphomeyaml is that you can template almost every parameter for actions in automations. For example if you have a light and want to set it to a pre-defined color when a button is pressed, you can do this: -.. code:: yaml +.. code-block:: yaml on_press: then: @@ -246,8 +246,8 @@ if you have a light and want to set it to a pre-defined color when a button is p red: 0.8 green: 1.0 blue: !lambda >- - # The sensor outputs values from 0 to 100. The blue - # part of the light color will be determined by the sensor value. + // The sensor outputs values from 0 to 100. The blue + // part of the light color will be determined by the sensor value. return id(some_sensor).state / 100.0; Every parameter in actions that has the label "templatable" in the docs can be templated like above, using @@ -262,7 +262,7 @@ Bonus 2: Global Variables In some cases you might require to share a global variable across multiple lambdas. For example, global variables can be used to store the state of a garage door. -.. code:: yaml +.. code-block:: yaml # Example configuration entry globals: @@ -364,7 +364,7 @@ All Actions This action delays the execution of the next action in the action list by a specified time period. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -386,11 +386,11 @@ time period. This action executes an arbitrary piece of C++ code (see :ref:`Lambda `). -.. code:: yaml +.. code-block:: yaml on_...: then: - - lambda: >- + - lambda: |- id(some_binary_sensor).publish_state(false); .. _if_action: @@ -406,7 +406,7 @@ After the chosen branch (``then`` or ``else``) is done with execution, the next For example below you can see an automation that checks if a sensor value is below 30 and if so turns on a light for 5 seconds. Otherwise, the light is turned off immediately. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -441,7 +441,7 @@ Using this action you can manually call the ``update()`` method of a component. Please note that this only works with some component types and others will result in a compile error. -.. code:: yaml +.. code-block:: yaml on_...: then: @@ -462,7 +462,7 @@ triggers. With the ``script`` component you can define these steps in a central place, and then execute the script with a single call. -.. code:: yaml +.. code-block:: yaml # Example configuration entry script: diff --git a/esphomeyaml/guides/cli.rst b/esphomeyaml/guides/cli.rst index 9df0df204..83123485f 100644 --- a/esphomeyaml/guides/cli.rst +++ b/esphomeyaml/guides/cli.rst @@ -9,7 +9,7 @@ Base Usage esphomeyaml's command line interface always has the following format -.. code:: console +.. code-block:: console esphomeyaml [ARGUMENTS] diff --git a/esphomeyaml/guides/configuration-types.rst b/esphomeyaml/guides/configuration-types.rst index 5186693a6..7122d1aa4 100644 --- a/esphomeyaml/guides/configuration-types.rst +++ b/esphomeyaml/guides/configuration-types.rst @@ -3,7 +3,7 @@ Configuration Types .. seo:: :description: Documentation of different configuration types in esphomelib - :image: settings.svg + :image: settings.png esphomeyaml’s configuration files have several configuration types. This page describes them. @@ -23,7 +23,7 @@ ID twice. Because esphomeyaml converts your configuration into C++ code and the ids are in reality just C++ variable names, they must also adhere to C++’s naming conventions. `C++ Variable -names `__ +names `__ … - … must start with a letter and can end with numbers. @@ -49,7 +49,7 @@ for the ``D0`` (as printed on the PCB silkscreen) pin on the NodeMCU ESP8266 has the internal GPIO name ``GPIO16``, but also has an alias ``D0``. So using either one of these names in your configuration will lead to the same result. -.. code:: yaml +.. code-block:: yaml some_config_option: pin: GPIO16 @@ -65,7 +65,7 @@ Pin Schema In some places, esphomeyaml also supports a more advanced “pin schema”. -.. code:: yaml +.. code-block:: yaml some_config_option: # Basic: @@ -116,7 +116,7 @@ Time In lots of places in esphomeyaml you need to define time periods. There are several ways of doing this. See below examples to see how you can specify time periods: -.. code:: yaml +.. code-block:: yaml some_config_option: some_time_option: 1000us # 1000 microseconds = 1ms diff --git a/esphomeyaml/guides/contributing.rst b/esphomeyaml/guides/contributing.rst index 7c82acdd0..c5ebbadd8 100644 --- a/esphomeyaml/guides/contributing.rst +++ b/esphomeyaml/guides/contributing.rst @@ -3,7 +3,7 @@ Contributing .. seo:: :description: Getting started guide for contributing to the esphomelib project - :image: github-circle.svg + :image: github-circle.png Contributions to the esphomelib suite are very welcome! All the code for the projects is hosted on GitHub and you can find the sources here: @@ -31,21 +31,21 @@ RST primer: - **Headers**: You can write titles like this: - .. code:: rst + .. code-block:: rst My Title ======== and section headers like this: - .. code:: rst + .. code-block:: rst My Sub Section -------------- and sub-section headers like this: - .. code:: rst + .. code-block:: rst My Sub-sub section ****************** @@ -53,7 +53,7 @@ RST primer: - **Links**: To create a link to an external resource (for example https://www.google.com), use ``\`Link text \`__``. For example: - .. code:: rst + .. code-block:: rst `Google.com `__ @@ -62,7 +62,7 @@ RST primer: - **References**: To reference another document, use the ``:doc:`` and ``:ref:`` roles (references are set up globally and can be used between documents): - .. code:: rst + .. code-block:: rst .. _my-reference-label: @@ -77,17 +77,17 @@ RST primer: - **Inline code**: To have text appear ``like this``, use double backticks: - .. code:: rst + .. code-block:: rst To have text appear ``like this``, use double backticks. To have text appear ``like this``, use double backticks. -- **Code blocks**: To show a sample configuration file, use the ``code`` directive: +- **Code blocks**: To show a sample configuration file, use the ``code-block`` directive: - .. code:: rst + .. code-block:: rst - .. code:: yaml + .. code-block:: yaml # Sample configuration entry switch: @@ -95,7 +95,7 @@ RST primer: name: "Relay #42" pin: GPIO13 - .. code:: yaml + .. code-block:: yaml # Sample configuration entry switch: @@ -103,14 +103,9 @@ RST primer: name: "Relay #42" pin: GPIO13 - .. note:: - - The YAML syntax highlighter is currently broken. Somehow sphinx thinks this should be - C++ code 🤯. If you know how to fix this, it would be very much appreciated 😉 - - **Images**: To show images, use the ``figure`` directive: - .. code:: rst + .. code-block:: rst .. figure:: images/dashboard.png :align: center @@ -127,7 +122,7 @@ RST primer: - **Notes and warnings**: You can create simple notes and warnings using the ``note`` and ``warning`` directives: - .. code:: rst + .. code-block:: rst .. note:: @@ -148,7 +143,7 @@ RST primer: - **Italic and boldface font families**: To *italicize* text, use one asterisk around the text. To put **a strong emphasis** on a piece of text, put two asterisks around it. - .. code:: rst + .. code-block:: rst *This is italicized.* (A weird word...) **This is very important.** @@ -158,7 +153,7 @@ RST primer: - **Ordered and unordered list**: The syntax for lists in RST is more or less the same as in markdown: - .. code:: rst + .. code-block:: rst - Unordered Item @@ -186,7 +181,7 @@ please have a look at the `Sphinx reStructuredText Primer `__. -.. code:: bash +.. code-block:: bash # in esphomedocs repo: pip3 install -r requirements.txt @@ -195,7 +190,7 @@ To check your documentation changes locally, you first need install sphinx (**wi Alternatively, you can use the `esphomedocs docker image `__: - .. code:: bash + .. code-block:: bash docker run --rm -v "$PWD/..":/data -p 8000:8000 -it ottowinter/esphomedocs @@ -204,7 +199,7 @@ To check your documentation changes locally, you first need install sphinx (**wi Next, you will also need to clone the `esphomelib repository `__ into the folder where ``esphomedocs`` sits like this: -.. code:: +.. code-block:: text ├── esphomedocs/ │   ├── api/ @@ -222,7 +217,7 @@ the folder where ``esphomedocs`` sits like this: Then, use the provided Makefile to build the changes and start a simple web server: -.. code:: bash +.. code-block:: bash # Update doxygen API docs make doxyg @@ -256,7 +251,7 @@ look around the code base a bit and see how other components are doing stuff. To initialize the development environment, navigate to the repository and execute: -.. code:: bash +.. code-block:: bash # View available IDEs: pio init --help @@ -329,13 +324,13 @@ it in the configuration. Specifically, it may contain these fields: and add it to the global expression index. The return value is the left hand side variable which you can use for further calls. - .. code:: cpp + .. code-block:: cpp = ; - Register a variable of a pointer type using ``Pvariable(, , rhs)``. - .. code:: cpp + .. code-block:: cpp * = ; @@ -352,14 +347,14 @@ it in the configuration. Specifically, it may contain these fields: the correct operator. Additionally, you can pass a type as the second argument to ``get_variable``. This will cause esphomeyaml to use the first variable of that type. - .. code:: cpp + .. code-block:: cpp hub = get_variable(config.get(CONF_DALLAS_ID), DallasComponent) - Pass configuration arguments to mock function calls (like ``App.make_dallas_component``) using normal python :) - .. code:: python + .. code-block:: python rhs = App.make_dallas_component(config[CONF_PIN], config.get(CONF_UPDATE_INTERVAL)) @@ -367,7 +362,7 @@ it in the configuration. Specifically, it may contain these fields: - ``BUILD_FLAGS``: Pass build flags that should be provided if your component is loaded. - .. code:: python + .. code-block:: python BUILD_FLAGS = '-DUSE_DALLAS_SENSOR' diff --git a/esphomeyaml/guides/faq.rst b/esphomeyaml/guides/faq.rst index 0642915cf..d7d2682dc 100644 --- a/esphomeyaml/guides/faq.rst +++ b/esphomeyaml/guides/faq.rst @@ -3,7 +3,7 @@ Frequently Asked Questions .. seo:: :description: Frequently asked questions in esphomelib. - :image: question_answer.svg + :image: question_answer.png Tips for using esphomeyaml -------------------------- @@ -14,20 +14,20 @@ Tips for using esphomeyaml 2. If you want to see how esphomeyaml interprets your configuration, run - .. code:: bash + .. code-block:: bash esphomeyaml livingroom.yaml config 3. To view the logs from your node without uploading, run - .. code:: bash + .. code-block:: bash esphomeyaml livingroom.yaml logs 4. If you have changed the name of the node and want to update over-the-air, just specify ``--upload-port`` when running esphomeyaml. For example: - .. code:: bash + .. code-block:: bash esphomeyaml livingroom.yaml run --upload-port 192.168.178.52 @@ -121,12 +121,15 @@ great way for me to track and (hopefully) fix issues, so thank you! For me to fix the issue the quickest, there are some things that would be really helpful: -1. How do you use esphomelib? Through esphomeyaml or directly through C++ code? -2. If it's a build/upload issue: What system are you compiling/uploading things from? Windows, POSIX, from docker? -3. A snippet of the code/configuration file used is always great for a better understanding of the issue. -4. If it's an i2c or hardware communication issue please also try setting the +1. **Just writing "X doesn't work" or "X gives bug" is not helpful!!!** Seriously, how do you expect + me to help given just that information? +2. A snippet of the code/configuration file used is always great for me to reproduce this issue. + Please read `How to create a Minimal, Complete, and Verifiable example `__. +3. If it's an i2c or hardware communication issue please also try setting the :ref:`log level ` to ``VERY_VERBOSE`` as it provides helpful information about what is going on. +4. Please also include what you've already tried and didn't work so that these things can + be You can find the issue tracker here https://github.com/OttoWinter/esphomelib/issues @@ -135,7 +138,7 @@ How do I update to the latest version? It's simple. Run: -.. code:: bash +.. code-block:: bash pip2 install -U esphomeyaml # From docker: @@ -152,7 +155,7 @@ esphomelib has a beta release cycle so that new releases can easily be tested be the changes are deployed to the stable channel. You can help test esphomeyaml (and use new features) by installing the esphomeyaml beta: -.. code:: bash +.. code-block:: bash # For pip-based installs pip2 install --pre -U esphomeyaml @@ -208,7 +211,7 @@ I have a question... How can I contact you? Sure! I'd be happy to help :) You can contact me here: - `Discord `__ -- `Home Assistant Community Forums `__ +- `Home Assistant Community Forums `__ - `esphomelib `__ and `esphomeyaml `__ issue trackers. Preferably only for issues and feature requests. @@ -275,7 +278,7 @@ If even this doesn't work or you like to have a lot of components enabled there First we temporary 'remove' (comment out) all components from the ``yaml`` file, leaving only: ``esphomeyaml``, ``ota`` and ``wifi``, example: -.. code:: yaml +.. code-block:: yaml esphomeyaml: name: sonoff_basic diff --git a/esphomeyaml/guides/getting_started_command_line.rst b/esphomeyaml/guides/getting_started_command_line.rst index 3dc007de1..63e8a564c 100644 --- a/esphomeyaml/guides/getting_started_command_line.rst +++ b/esphomeyaml/guides/getting_started_command_line.rst @@ -3,7 +3,7 @@ Getting Started with esphomeyaml .. seo:: :description: Getting Started guide for installing esphomeyaml using the command line and creating a basic configuration. - :image: console.svg + :image: console.png esphomeyaml is the perfect solution for creating custom firmwares for your ESP8266/ESP32 boards. In this guide we’ll go through how to setup a @@ -17,7 +17,7 @@ Installing esphomeyaml is very easy. All you need to do is have `Python (because of platformio 😕) and install the console script script through ``pip``. -.. code:: bash +.. code-block:: bash pip install esphomeyaml @@ -25,7 +25,7 @@ Alternatively, there’s also a docker image available for easy installation (the docker hub image is only available for amd64 right now; if you have an RPi, please install esphomelib through ``pip`` or use :doc:`the HassIO add-on `: -.. code:: bash +.. code-block:: bash docker pull ottowinter/esphomeyaml @@ -37,7 +37,7 @@ friendly setup wizard that will guide you through creating your first configuration file. For example, if you want to create a configuration file called ``livingroom.yaml``: -.. code:: bash +.. code-block:: bash esphomeyaml livingroom.yaml wizard # On Docker: @@ -59,7 +59,7 @@ So now you should have a file called ``livingroom.yaml`` (or similar). Go open that file in an editor of your choice and let’s add a :doc:`simple GPIO switch ` to our app. -.. code:: yaml +.. code-block:: yaml switch: - platform: gpio @@ -84,7 +84,7 @@ you have something you want to upload to your ESP board, simply plug in the device via USB and type the following command (replacing ``livingroom.yaml`` with your configuration file): -.. code:: bash +.. code-block:: bash esphomeyaml livingroom.yaml run @@ -102,7 +102,7 @@ uploading on the host system. If you are running docker on Linux you can add ``--device=/dev/ttyUSB0`` to your docker command to map a local USB device. -.. code:: bash +.. code-block:: bash docker run --rm -v "`pwd`":/config -it ottowinter/esphomeyaml livingroom.yaml compile platformio run -d livingroom -t upload @@ -126,7 +126,7 @@ Next, we’re going to add a very simple binary sensor that periodically checks a GPIO pin whether it’s pulled high or low - the :doc:`GPIO Binary Sensor `. -.. code:: yaml +.. code-block:: yaml binary_sensor: - platform: gpio @@ -145,7 +145,7 @@ through USB again. The upload will magically happen “over the air”. Using esphomeyaml directly, this is the same as from a USB cable, but for docker you need to supply an additional parameter: -.. code:: bash +.. code-block:: bash esphomeyaml livingroom.yaml run # On docker @@ -177,7 +177,7 @@ easily manage your nodes from a nice web interface. It was primarily designed fo To start the esphomeyaml dashboard, simply start esphomeyaml with the following command (with ``config/`` pointing to a directory where you want to store your configurations) -.. code:: bash +.. code-block:: bash # Install dashboard dependencies pip2 install tornado esptool @@ -204,7 +204,7 @@ be edited and all changes in there will be overriden, but outside of those comments you can safely create custom sensors while still using esphomeyaml’s great configuration options. -.. code:: cpp +.. code-block:: cpp // Auto generated code by esphomeyaml #include "esphomelib/application.h" @@ -223,7 +223,6 @@ esphomeyaml’s great configuration options. void loop() { App.loop(); - delay(20); } See Also diff --git a/esphomeyaml/guides/getting_started_hassio.rst b/esphomeyaml/guides/getting_started_hassio.rst index 1fbbc5503..7bfa2af48 100644 --- a/esphomeyaml/guides/getting_started_hassio.rst +++ b/esphomeyaml/guides/getting_started_hassio.rst @@ -3,7 +3,7 @@ Getting Started with esphomeyaml through HassIO .. seo:: :description: Getting Started guide for installing esphomeyaml as a HassIO Add-on and creating a basic configuration. - :image: home-assistant.svg + :image: home-assistant.png esphomeyaml is the perfect solution for creating custom firmwares for your ESP8266/ESP32 boards. In this guide we’ll go through how to setup a @@ -99,7 +99,7 @@ So now you should have a file called ``/config/esphomeyaml/livingroom.yaml`` (or Go open that file in and add a :doc:`simple GPIO switch ` to the configuration like this: -.. code:: yaml +.. code-block:: yaml switch: - platform: gpio @@ -129,7 +129,7 @@ Next, we’re going to add a very simple binary sensor that periodically checks a GPIO pin whether it’s pulled high or low - the :doc:`GPIO Binary Sensor `. -.. code:: yaml +.. code-block:: yaml binary_sensor: - platform: gpio @@ -178,7 +178,7 @@ be edited and all changes in there will be overridden, but outside of those comments you can safely create custom sensors while still using esphomeyaml’s great configuration options. -.. code:: cpp +.. code-block:: cpp // Auto generated code by esphomeyaml #include "esphomelib/application.h" @@ -197,7 +197,6 @@ esphomeyaml’s great configuration options. void loop() { App.loop(); - delay(20); } See Also diff --git a/esphomeyaml/guides/migrate_espeasy.rst b/esphomeyaml/guides/migrate_espeasy.rst index d86a881d8..1646c1abe 100644 --- a/esphomeyaml/guides/migrate_espeasy.rst +++ b/esphomeyaml/guides/migrate_espeasy.rst @@ -3,7 +3,7 @@ Migrating from ESPEasy .. seo:: :description: Migration guide for installing esphomelib on ESPs running ESPEasy. - :image: espeasy.svg + :image: espeasy.png Migrating from previous ESPEasy setups is very easy. You just need to have esphomeyaml create a binary for you and then upload that in the ESPEasy web interface. diff --git a/esphomeyaml/guides/migrate_espurna.rst b/esphomeyaml/guides/migrate_espurna.rst index 1feb3bf3d..3089958f4 100644 --- a/esphomeyaml/guides/migrate_espurna.rst +++ b/esphomeyaml/guides/migrate_espurna.rst @@ -3,7 +3,7 @@ Migrating from ESPurna .. seo:: :description: Migration guide for installing esphomelib on ESPs running ESPurna. - :image: espurna.svg + :image: espurna.png Migrating from previous ESPurna setups is very easy. You just need to have esphomeyaml create a binary for you and then upload that in the ESPurna web interface. diff --git a/esphomeyaml/guides/migrate_sonoff_tasmota.rst b/esphomeyaml/guides/migrate_sonoff_tasmota.rst index 457d31c45..a21640a5c 100644 --- a/esphomeyaml/guides/migrate_sonoff_tasmota.rst +++ b/esphomeyaml/guides/migrate_sonoff_tasmota.rst @@ -3,7 +3,7 @@ Migrating from Sonoff Tasmota .. seo:: :description: Migration guide for installing esphomelib on ESPs running Sonoff Tasmota. - :image: tasmota.svg + :image: tasmota.png Migrating from previous Sonoff Tasmota setups is very easy. You just need to have esphomeyaml create a binary for you and then upload that in the Tasmota web interface. diff --git a/esphomeyaml/index.rst b/esphomeyaml/index.rst index 25fe047f2..ba4c2e59a 100644 --- a/esphomeyaml/index.rst +++ b/esphomeyaml/index.rst @@ -4,8 +4,8 @@ esphomeyaml .. image:: images/esphomeyaml-logo-full.svg .. seo:: - :description: esphomeyaml Component index - Reimagining DIY Home Automation - :image: /_static/logo-full.png + :description: esphomeyaml Component index - esphomeyaml Homepage - Reimagining DIY Home Automation. esphomelib is a framework that tries to provide the best possible use experience for using ESP8266 and ESP32 microcontrollers for Home Automation. esphomeyaml is the tool that converts YAML configuration files into custom firmwares and has many helpers so that you only have to worry about creating the hardware, esphomeyaml will take care of the rest. + :image: esphomeyaml-logo-full.png .. raw:: html diff --git a/githubpages.py b/githubpages.py new file mode 100644 index 000000000..2ea6323c1 --- /dev/null +++ b/githubpages.py @@ -0,0 +1,14 @@ +import os + +def create_nojekyll(app, env): + if app.builder.format == 'html': + path = os.path.join(app.builder.outdir, '.nojekyll') + open(path, 'wt').close() + + path = os.path.join(app.builder.outdir, 'CNAME') + with open(path, 'wt') as f: + f.write(os.getenv('CNAME', 'esphomelib.com')) + + +def setup(app): + app.connect('env-updated', create_nojekyll) diff --git a/index.rst b/index.rst index 36c897de4..4f2a5791c 100644 --- a/index.rst +++ b/index.rst @@ -5,8 +5,8 @@ esphomelib :google-site-verification: qclmMpSERA2uy_ZceVgL6ijwkeEHer75LEPyyTQnK4E .. seo:: - :description: esphomeyaml Homepage - Reimagining DIY Home Automation - :image: /_static/logo-full.png + :description: esphomelib Homepage - Reimagining DIY Home Automation. esphomelib is a framework that tries to provide the best possible use experience for using ESP8266 and ESP32 microcontrollers for Home Automation. + :image: logo-full.png .. image:: /esphomeyaml/images/logo-full.svg @@ -32,9 +32,9 @@ 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 `__. + * Compile the sketch file for you using `platformio `__. * Upload the binary to your ESP via Over the Air updates. - * If you're using `Home Assistant `__, esphomelib + * If you're using `Home Assistant `__, esphomelib will automatically add all components to the home assistant UI. Features diff --git a/seo.py b/seo.py index 95c8109e7..d8fd3b112 100644 --- a/seo.py +++ b/seo.py @@ -95,10 +95,6 @@ class SEODirective(Directive): if not image.startswith('/'): image = '/_images/' + image self.options['image'] = env.config.html_baseurl + image - description = self.options.get('description') - if description is not None and len(description) >= 200: - self.options['description'] = description[:200].rsplit(' ', 1)[0] + '...' - return [SEONode(**self.options)] diff --git a/svg2png.py b/svg2png.py new file mode 100644 index 000000000..33408c383 --- /dev/null +++ b/svg2png.py @@ -0,0 +1,31 @@ +import os +import shlex +import subprocess + + +path = '_build/html/_images/' + +for from_ in os.listdir(path): + if not from_.endswith('.svg'): + continue + + to_ = from_[:-len('.svg')] + '.png' + from_ = os.path.abspath(os.path.join(path, from_)) + to_ = os.path.abspath(os.path.join(path, to_)) + + if os.path.exists(to_): + to_mtime = os.path.getmtime(to_) + from_mtime = os.path.getmtime(from_) + if to_mtime > from_mtime: + # Let's not re-convert files if we've already converted them + # Yes, mtime is not great but it's better than having the builds take + # ages + continue + + args = ['inkscape', '-z', '-e', to_, '-w', '800', + '-background', 'white', from_] + print("Running: {}".format(' '.join(shlex.quote(x) for x in args))) + proc = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + if b'Bitmap saved as' not in proc.stdout: + print("Error!") + print(proc.stdout) diff --git a/web-api/index.rst b/web-api/index.rst index a32133065..9dfdaafc9 100644 --- a/web-api/index.rst +++ b/web-api/index.rst @@ -3,7 +3,7 @@ Web Server API .. seo:: :description: Migration guide for installing esphomelib on ESPs running ESPEasy. - :image: espeasy.svg + :image: espeasy.png Since version 1.3, esphomelib includes a built-in web server that can be used to view states and send commands. In addition to visible the web-frontend available under the root index of the From e57247fc38cee8d296a8d481d3c07e2bd2356094 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 19 Nov 2018 19:05:59 +0100 Subject: [PATCH 12/35] Fix build --- .gitlab-ci.yml | 1 + Makefile | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8b1332c41..13efcdb7b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,6 +17,7 @@ - git worktree add _build/html gh-pages - make ../esphomelib - make html + - make convertimages - git -C _build/html add --all - git -C _build/html commit -m "Deploy to gh-pages" - git -C _build/html push -f git@github.com:${TARGET_REPO}.git gh-pages diff --git a/Makefile b/Makefile index 38777a2e6..dcee9b3c0 100644 --- a/Makefile +++ b/Makefile @@ -35,10 +35,6 @@ $(ESPHOMELIB_PATH): convertimages: python3 svg2png.py -deploy: cleanhtml doxyg html $(ESPHOMELIB_PATH) convertimages - git -C "$(BUILDDIR)/html" add --all && git -C "$(BUILDDIR)/html" commit -m "Deploy to gh-pages" - @printf "Run \033[0;36mcd $(BUILDDIR)/html && git push origin gh-pages\033[0m to deploy\n" - help: $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) From 2f1129a1e3debb5772a8b5dbf5fce47852347349 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 19 Nov 2018 23:05:11 +0100 Subject: [PATCH 13/35] Bump version to v1.9.1 --- Doxygen | 2 +- Makefile | 2 +- conf.py | 2 +- esphomeyaml/changelog/index.rst | 10 ++++++++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Doxygen b/Doxygen index 60f731554..df6b377e1 100644 --- a/Doxygen +++ b/Doxygen @@ -38,7 +38,7 @@ PROJECT_NAME = "esphomelib" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.9.0 +PROJECT_NUMBER = 1.9.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Makefile b/Makefile index dcee9b3c0..e73a73419 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ SPHINXPROJ = esphomelib SOURCEDIR = . BUILDDIR = _build ESPHOMELIB_PATH = ../esphomelib -ESPHOMELIB_TAG = v1.9.0 +ESPHOMELIB_TAG = v1.9.1 CNAME = esphomelib.com .PHONY: html cleanhtml doxyg cleandoxyg deploy help webserver Makefile $(ESPHOMELIB_PATH) diff --git a/conf.py b/conf.py index db615ec94..e94ed8d72 100644 --- a/conf.py +++ b/conf.py @@ -78,7 +78,7 @@ author = 'Otto Winter' # The short X.Y version. version = '1.9' # The full version, including alpha/beta/rc tags. -release = '1.9.0' +release = '1.9.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/esphomeyaml/changelog/index.rst b/esphomeyaml/changelog/index.rst index 38405d810..e74068fee 100644 --- a/esphomeyaml/changelog/index.rst +++ b/esphomeyaml/changelog/index.rst @@ -158,6 +158,16 @@ Breaking Changes the :docspr:`62` changeset for more information (:libpr:`231`, :docspr:`62`, :yamlpr:`197`) +Release 1.9.1 - November 19 +--------------------------- + +- lib: Fix RDM6300 not reporting cards :libpr:`278` +- lib: Fix SNTP with less than 3 servers :libpr:`279` +- lib: Fix update interval log missing time unit :libpr:`280` +- lib: Fix CSE7766 spamming logs :libpr:`281` +- lib: Fix outdated links :libpr:`282` +- yaml: Fix SNTP servers option :yamlpr:`237` + All changes ----------- From fa29e33dc15f15b2ef8206fde8cfa37b786df86c Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Fri, 23 Nov 2018 11:17:40 +0100 Subject: [PATCH 14/35] Update index.rst --- esphomeyaml/components/display/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphomeyaml/components/display/index.rst b/esphomeyaml/components/display/index.rst index 5b8298912..ece027f2b 100644 --- a/esphomeyaml/components/display/index.rst +++ b/esphomeyaml/components/display/index.rst @@ -198,7 +198,7 @@ pointed, so that, as the name implies, the anchor point is a the *top right* cor it.print(0, 0, id(my_font), "Left aligned"); // Aligned on right edge - it.print(0, it.get_width(), id(my_font), TextAlign::TOP_RIGHT, "Right aligned"); + it.print(it.get_width(), 0, id(my_font), TextAlign::TOP_RIGHT, "Right aligned"); As with basic shapes, you can also specify a color for the text: From d0a3e883d77d7e535545e8ca454f54852c4f5ef3 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Fri, 23 Nov 2018 12:33:49 +0100 Subject: [PATCH 15/35] Log level description --- esphomeyaml/components/logger.rst | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/esphomeyaml/components/logger.rst b/esphomeyaml/components/logger.rst index bc94c5a90..e5f16925f 100644 --- a/esphomeyaml/components/logger.rst +++ b/esphomeyaml/components/logger.rst @@ -39,13 +39,37 @@ Log Levels Possible log levels are (sorted by severity): - ``NONE`` + + - No messages are logged. + - ``ERROR`` + + - With this log level, only errors are logged. Errors are issues that prevent the ESP from working + correctly. Color: red + - ``WARN`` + + - With this log level, warnings and errors are logged. Warnings are issues like invalid readings from + sensors that esphomelib can recover from. Color: yellow + - ``INFO`` -- ``DEBUG`` + + - With this log level, everything up to info messages are logged; so errors, warnings and info. Color: green + +- ``DEBUG`` (**Default**) + + - Everything up to this log level is logged. Debug messages include the current readings from a sensor + and status messages. Color: cyan + - ``VERBOSE`` + + - Like debug, but a few more messages that are usually deemed to be spam are also included. Color: grey + - ``VERY_VERBOSE`` + - All internal messages are logged. Including all the data flowing through data buses like + i2c, spi or uart. Color: white + .. _logger-manual_tag_specific_levels: Manual Tag-Specific Log Levels From 4b608fb782e3af0ede626e102c4ca868446c2095 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Fri, 23 Nov 2018 12:33:59 +0100 Subject: [PATCH 16/35] ESP32 BLE tracker flash note --- esphomeyaml/components/binary_sensor/esp32_ble_tracker.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esphomeyaml/components/binary_sensor/esp32_ble_tracker.rst b/esphomeyaml/components/binary_sensor/esp32_ble_tracker.rst index 62a16f493..30f5ef72b 100644 --- a/esphomeyaml/components/binary_sensor/esp32_ble_tracker.rst +++ b/esphomeyaml/components/binary_sensor/esp32_ble_tracker.rst @@ -49,7 +49,11 @@ the logs to see discovered Bluetooth Low Energy devices. # Example configuration entry for finding MAC addresses esp32_ble_tracker: -Using above configuration, first you should see a ``Starting scan...`` debug message at +After adding that to your configuration, you will need to re-flash the ESP32 over USB, as esphomeyaml +needs to repartition the flash memory of the ESP in order to allow for the increased firmware size that +the BLE stack requires. + +Using the configuration above, first you should see a ``Starting scan...`` debug message at boot-up. Then, when a BLE device is discovered, you should see messages like ``Found device AC:37:43:77:5F:4C`` together with some information about their address type and advertised name. If you don't see these messages, your device is unfortunately From bfb9b234c74237b69042ef892c46dd1c155b6238 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sun, 25 Nov 2018 19:17:47 +0100 Subject: [PATCH 17/35] Bump version to v1.9.2 --- Doxygen | 2 +- Makefile | 2 +- conf.py | 2 +- esphomeyaml/changelog/index.rst | 8 ++++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Doxygen b/Doxygen index df6b377e1..7703d3450 100644 --- a/Doxygen +++ b/Doxygen @@ -38,7 +38,7 @@ PROJECT_NAME = "esphomelib" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.9.1 +PROJECT_NUMBER = 1.9.2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Makefile b/Makefile index e73a73419..c42b9550b 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ SPHINXPROJ = esphomelib SOURCEDIR = . BUILDDIR = _build ESPHOMELIB_PATH = ../esphomelib -ESPHOMELIB_TAG = v1.9.1 +ESPHOMELIB_TAG = v1.9.2 CNAME = esphomelib.com .PHONY: html cleanhtml doxyg cleandoxyg deploy help webserver Makefile $(ESPHOMELIB_PATH) diff --git a/conf.py b/conf.py index e94ed8d72..a9aa5fb23 100644 --- a/conf.py +++ b/conf.py @@ -78,7 +78,7 @@ author = 'Otto Winter' # The short X.Y version. version = '1.9' # The full version, including alpha/beta/rc tags. -release = '1.9.1' +release = '1.9.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/esphomeyaml/changelog/index.rst b/esphomeyaml/changelog/index.rst index e74068fee..f91f9fb50 100644 --- a/esphomeyaml/changelog/index.rst +++ b/esphomeyaml/changelog/index.rst @@ -168,6 +168,14 @@ Release 1.9.1 - November 19 - lib: Fix outdated links :libpr:`282` - yaml: Fix SNTP servers option :yamlpr:`237` +Release 1.9.2 - November 25 +--------------------------- + +- lib: Fix crashing when logger not being used :libpr:`285` +- lib: Fix template cover spamming logs :libpr:`287` +- lib: Improve ESP32 BLE tracker stability :libpr:`289` +- lib: Fix sensor filters using C++ undefined behavior :libpr:`293` + All changes ----------- From 627537f5401d2eaf66f4b9b1f02a4aed4e9d8cf5 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Tue, 27 Nov 2018 17:05:50 +0100 Subject: [PATCH 18/35] Fix link --- esphomeyaml/components/esphomeyaml.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphomeyaml/components/esphomeyaml.rst b/esphomeyaml/components/esphomeyaml.rst index 5cc5392ff..1212fafe7 100644 --- a/esphomeyaml/components/esphomeyaml.rst +++ b/esphomeyaml/components/esphomeyaml.rst @@ -82,7 +82,7 @@ the latest development code from GitHub (``dev``), or a specific version number esphomelib_version: 1.8.0 Alternatively, if you want to develop for esphomelib, you can download the -`latest code from GitHub `, extract the contents, +`latest code from GitHub `__, extract the contents, and point esphomeyaml to your local copy. Then you can modify the esphomelib to your needs or to fix bugs. .. code-block:: yaml From 6d901142d84771597b0bc7e5d6b2a34f36f423ee Mon Sep 17 00:00:00 2001 From: sherbang Date: Tue, 27 Nov 2018 17:44:41 -0500 Subject: [PATCH 19/35] Fix Sonoff Basic pinouts (#88) GPIO 4 and 17 are only available by soldering directly to the MCU. Unlike the S20, the Sonoff Basic doesn't have a red LED. Added pin numbers for the 3 GPIOs that are available on the programming header. Added link of Sonoff-Tasmota wiki page with an image of pinout locations --- esphomeyaml/devices/sonoff_basic.rst | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/esphomeyaml/devices/sonoff_basic.rst b/esphomeyaml/devices/sonoff_basic.rst index 4ad1e8cf5..34130188f 100644 --- a/esphomeyaml/devices/sonoff_basic.rst +++ b/esphomeyaml/devices/sonoff_basic.rst @@ -46,19 +46,15 @@ exposes all of the basic functions. ================================================== ================================================== ``GPIO0`` Button (inverted) -------------------------------------------------- -------------------------------------------------- - ``GPIO1`` ``RX`` pin (for external sensors) + ``GPIO1`` ``RX`` pin (C1 Pin 2) -------------------------------------------------- -------------------------------------------------- - ``GPIO3`` ``TX`` pin (for external sensors) + ``GPIO3`` ``TX`` pin (C1 Pin 3) -------------------------------------------------- -------------------------------------------------- - ``GPIO4`` Optional Sensor - -------------------------------------------------- -------------------------------------------------- - ``GPIO12`` Relay and Red LED + ``GPIO12`` Relay -------------------------------------------------- -------------------------------------------------- ``GPIO13`` Green LED (inverted) -------------------------------------------------- -------------------------------------------------- - ``GPIO14`` Optional Sensor - -------------------------------------------------- -------------------------------------------------- - ``GPIO17`` Analog Input + ``GPIO14`` Optional Sensor (C1 Pin 5) ================================================== ================================================== .. code-block:: yaml @@ -130,6 +126,7 @@ See Also - :doc:`sonoff` - :doc:`sonoff_4ch` - :doc:`sonoff_s20` +- `GPIO locations `__ - `Edit this page on GitHub `__ .. disqus:: From 9f2ac733106fb7484d6cafba7850c8db5b5240f3 Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 28 Nov 2018 00:03:27 +0100 Subject: [PATCH 20/35] Update cwww.rst (#85) --- esphomeyaml/components/light/cwww.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphomeyaml/components/light/cwww.rst b/esphomeyaml/components/light/cwww.rst index 78660e8c9..cfbdd6cd3 100644 --- a/esphomeyaml/components/light/cwww.rst +++ b/esphomeyaml/components/light/cwww.rst @@ -13,7 +13,7 @@ channels will be mixed using the color temperature configuration options. # Example configuration entry light: - - platform: rgbw + - platform: cwww name: "Livingroom Lights" cold_white: output_component1 warm_white: output_component2 From 3a50c1901ba6d0c1c7057433200dfff534cab1f6 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sat, 1 Dec 2018 13:09:57 +0100 Subject: [PATCH 21/35] CSE7766 Stable --- esphomeyaml/components/sensor/cse7766.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/esphomeyaml/components/sensor/cse7766.rst b/esphomeyaml/components/sensor/cse7766.rst index 1ed0d0892..4cddecbbc 100644 --- a/esphomeyaml/components/sensor/cse7766.rst +++ b/esphomeyaml/components/sensor/cse7766.rst @@ -6,11 +6,6 @@ CSE7766 Power Sensor :image: cse7766.png :keywords: cse7766, Sonoff Pow R2 -.. warning:: - - This integration is experimental as I don't have the hardware to test it (yet). - If you can verify it works (or if it doesn't), notify me on `discord `__. - The ``cse7766`` sensor platform allows you to use your CSE7766 voltage/current and power sensors (`datasheet `__) sensors with esphomelib. This sensor is commonly found in Sonoff POW R2. From 56addb4505d320e57eef522aaf50c4acf1a2648e Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sat, 1 Dec 2018 13:19:42 +0100 Subject: [PATCH 22/35] CSE7766 Update Interval (#91) --- esphomeyaml/components/sensor/cse7766.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphomeyaml/components/sensor/cse7766.rst b/esphomeyaml/components/sensor/cse7766.rst index 4cddecbbc..7a929dfad 100644 --- a/esphomeyaml/components/sensor/cse7766.rst +++ b/esphomeyaml/components/sensor/cse7766.rst @@ -47,6 +47,8 @@ Configuration variables: :ref:`Sensor ` and :ref:`MQTT Component `. - **voltage** (*Optional*): Use the voltage value of the sensor in V (RMS). All options from :ref:`Sensor ` and :ref:`MQTT Component `. +- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the + sensor. Defaults to ``15s``. See :ref:`sensor-default_filter`. - **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`UART Component ` if you want to use multiple UART buses. From 7735bb6282a74c58719c6b471c504721a7db049c Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sat, 1 Dec 2018 13:37:46 +0100 Subject: [PATCH 23/35] Bump version to v1.9.3 --- Doxygen | 2 +- Makefile | 2 +- _static/version | 1 + conf.py | 2 +- esphomeyaml/changelog/index.rst | 11 +++++++++++ 5 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 _static/version diff --git a/Doxygen b/Doxygen index 7703d3450..4d547fd5f 100644 --- a/Doxygen +++ b/Doxygen @@ -38,7 +38,7 @@ PROJECT_NAME = "esphomelib" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.9.2 +PROJECT_NUMBER = 1.9.3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Makefile b/Makefile index c42b9550b..365ea0192 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ SPHINXPROJ = esphomelib SOURCEDIR = . BUILDDIR = _build ESPHOMELIB_PATH = ../esphomelib -ESPHOMELIB_TAG = v1.9.2 +ESPHOMELIB_TAG = v1.9.3 CNAME = esphomelib.com .PHONY: html cleanhtml doxyg cleandoxyg deploy help webserver Makefile $(ESPHOMELIB_PATH) diff --git a/_static/version b/_static/version new file mode 100644 index 000000000..7b0231f53 --- /dev/null +++ b/_static/version @@ -0,0 +1 @@ +1.9.3 \ No newline at end of file diff --git a/conf.py b/conf.py index a9aa5fb23..2a99f764a 100644 --- a/conf.py +++ b/conf.py @@ -78,7 +78,7 @@ author = 'Otto Winter' # The short X.Y version. version = '1.9' # The full version, including alpha/beta/rc tags. -release = '1.9.2' +release = '1.9.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/esphomeyaml/changelog/index.rst b/esphomeyaml/changelog/index.rst index f91f9fb50..5897d30d9 100644 --- a/esphomeyaml/changelog/index.rst +++ b/esphomeyaml/changelog/index.rst @@ -176,6 +176,17 @@ Release 1.9.2 - November 25 - lib: Improve ESP32 BLE tracker stability :libpr:`289` - lib: Fix sensor filters using C++ undefined behavior :libpr:`293` +Release 1.9.3 - December 1 +-------------------------- + +- docs: Fix Sonoff Basic pinouts :docspr:`88` by :ghuser:`sherbang` +- docs: Update cwww.rst :docspr:`85` by :ghuser:`Melkor82` +- lib: Fix PMSX003 :libpr:`300` +- lib: Fix issue with filters introduced in 1.9.2 :libpr:`296` +- lib: Fix BMP085 pressure value :libpr:`292` +- yaml: CSE7766 update interval :yamlpr:`250` +- docs: CSE7766 Update Interval :docspr:`91` + All changes ----------- From df62b1bb9039262c3aceb74ec86bcfb5f91463d9 Mon Sep 17 00:00:00 2001 From: Drew Perttula Date: Sun, 2 Dec 2018 03:45:43 -0800 Subject: [PATCH 24/35] add baud_rate; typo on sensor type (#90) --- esphomeyaml/components/sensor/pmsx003.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphomeyaml/components/sensor/pmsx003.rst b/esphomeyaml/components/sensor/pmsx003.rst index 97ef469a7..cbab77318 100644 --- a/esphomeyaml/components/sensor/pmsx003.rst +++ b/esphomeyaml/components/sensor/pmsx003.rst @@ -30,10 +30,11 @@ value: # Example configuration entry uart: rx_pin: GPIO23 + baud_rate: 9600 sensor: - platform: pmsx003 - type: PMX003 + type: PMSX003 pm_1_0: name: "Particulate Matter <1.0µm Concentration" pm_2_5: From eb8d4ad3e811e45195dd23539afa802d128a28f0 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sun, 2 Dec 2018 13:12:27 +0100 Subject: [PATCH 25/35] Fix docs for LCD display strftime (#95) Fixes https://github.com/OttoWinter/esphomeyaml/issues/248 --- esphomeyaml/components/display/lcd_gpio.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/esphomeyaml/components/display/lcd_gpio.rst b/esphomeyaml/components/display/lcd_gpio.rst index 847088df9..2164e40f1 100644 --- a/esphomeyaml/components/display/lcd_gpio.rst +++ b/esphomeyaml/components/display/lcd_gpio.rst @@ -92,9 +92,14 @@ by default which means the character at the top left. // Result: "Sensor value: 42" // Print the current time - it.strftime("It is %H:%M on %d.%m.%Y"); + it.strftime("It is %H:%M on %d.%m.%Y", id(my_time).now()); // Result for 10:06 on august 21st 2018 -> "It is 10:06 on 21.08.2018" + # (Optional) For displaying time: + time: + - platform: sntp + id: my_time + .. note:: If you're not seeing anything on the display, make sure you try turning the contrast potentiometer around. From 4ca96657932660ec7d3bd9b0b14bd580b83343be Mon Sep 17 00:00:00 2001 From: Oscar Bolmsten Date: Tue, 11 Dec 2018 08:57:29 +0100 Subject: [PATCH 26/35] Fix copy paste error (#100) --- esphomeyaml/components/sensor/wifi_signal.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphomeyaml/components/sensor/wifi_signal.rst b/esphomeyaml/components/sensor/wifi_signal.rst index 4f9ecb006..c7e2cff2a 100644 --- a/esphomeyaml/components/sensor/wifi_signal.rst +++ b/esphomeyaml/components/sensor/wifi_signal.rst @@ -26,7 +26,7 @@ measured in decibels. These values are always negative and the closer they are t Configuration variables: ------------------------ -- **name** (**Required**, string): The name of the hall effect sensor. +- **name** (**Required**, string): The name of the WiFi signal sensor. - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``15s``. See :ref:`sensor-default_filter`. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. From bbb07952ca0311e09160e15fb607937828c3b98b Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Wed, 12 Dec 2018 16:24:43 +0100 Subject: [PATCH 27/35] Fix --- esphomeyaml/components/output/esp8266_pwm.rst | 8 +++----- seo.py | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/esphomeyaml/components/output/esp8266_pwm.rst b/esphomeyaml/components/output/esp8266_pwm.rst index 0a123a988..c15e30cd8 100644 --- a/esphomeyaml/components/output/esp8266_pwm.rst +++ b/esphomeyaml/components/output/esp8266_pwm.rst @@ -7,11 +7,9 @@ ESP8266 Software PWM Output The ESP8266 Software PWM platform allows you to use a software PWM on the pins GPIO0-GPIO16 on your ESP8266. As this is only a software PWM -and not a hardware PWM (like the :doc:`ESP32 LEDC PWM `) and has a few -limitations. - -- There can be a noticeable amount of flickering with increased WiFi activity. -- The output range only goes up to about 80%. +and not a hardware PWM (like the :doc:`ESP32 LEDC PWM `) and has a key +disadvantage: There can be a noticeable amount of flickering with increased WiFi +activity. If you need a stable PWM signal, it’s definitely recommended to use the successor of the ESP8266, the ESP32, and its :doc:`ESP32 LEDC PWM ` instead. diff --git a/seo.py b/seo.py index d8fd3b112..bb83a0605 100644 --- a/seo.py +++ b/seo.py @@ -52,7 +52,7 @@ def seo_visit(self: HTMLTranslator, node: SEONode): # Twitter create_content_meta("twitter:title", node.title) create_content_meta("twitter:image:src", node.image) - create_content_meta("twitter:card", "summary_large_image") + create_content_meta("twitter:card", "summary") create_content_meta("twitter:site", "@OttoWinter_") create_content_meta("twitter:creator", node.author_twitter) create_content_meta("twitter:description", node.description) From 86257d90303aad9c4a00c0452d6a274f3f565477 Mon Sep 17 00:00:00 2001 From: Adriaan Peeters Date: Sat, 15 Dec 2018 10:54:26 +0100 Subject: [PATCH 28/35] Add Wikipedia link to tz database zones list (#105) --- esphomeyaml/components/time.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphomeyaml/components/time.rst b/esphomeyaml/components/time.rst index 7b8ea1dd5..bab14df10 100644 --- a/esphomeyaml/components/time.rst +++ b/esphomeyaml/components/time.rst @@ -25,7 +25,7 @@ Configuration variables: - **id** (**Required**, :ref:`config-id`): Specify the ID of the time for use in lambdas. - **timezone** (*Optional*, string): Manually tell esphomelib what timezone to use with `this format - `__ (warning: the format is quite complicated). + `__ (warning: the format is quite complicated) or the simpler `TZ database name `__ in the form /. esphomeyaml tries to automatically infer the timezone string based on the timezone of the computer that is running esphomeyaml, but this might not always be accurate. - **servers** (*Optional*, list of strings): Choose up to 3 NTP servers that are used for the clock source. From 4143a11c8a599e3f9c664a7734bdf83fda57e6a0 Mon Sep 17 00:00:00 2001 From: Oscar Bolmsten Date: Sat, 15 Dec 2018 11:09:56 +0100 Subject: [PATCH 29/35] Add pins for Shelly 2 (#103) --- esphomeyaml/devices/sonoff.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/esphomeyaml/devices/sonoff.rst b/esphomeyaml/devices/sonoff.rst index 429bab1e1..47967a361 100644 --- a/esphomeyaml/devices/sonoff.rst +++ b/esphomeyaml/devices/sonoff.rst @@ -286,6 +286,16 @@ Shelly 1 GPIO4, Relay, GPIO5, SW Input, +Shelly 2 +-------- + +.. pintable:: + + GPIO4, Relay #1, + GPIO5, Relay #2, + GPIO12, SW Input #1, + GPIO14, SW Input #2, + See Also -------- From 8aa937ba156c2d462f09819cfbb4e8d74d7da662 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sun, 16 Dec 2018 11:08:54 +0100 Subject: [PATCH 30/35] Fix --- esphomeyaml/components/sensor/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphomeyaml/components/sensor/index.rst b/esphomeyaml/components/sensor/index.rst index 5eb96ecaa..bea9f72dd 100644 --- a/esphomeyaml/components/sensor/index.rst +++ b/esphomeyaml/components/sensor/index.rst @@ -212,7 +212,7 @@ Sensor Automation ----------------- You can access the most recent state of the sensor in :ref:`lambdas ` using -``id(sensor_id).state`` and the most recent raw state using ``id(sensor_id).raw_value``. +``id(sensor_id).state`` and the most recent raw state using ``id(sensor_id).raw_state``. .. _sensor-on_value: From 099ba374fbba57c84a30b82cc3616c5c7a26996c Mon Sep 17 00:00:00 2001 From: Xuming Feng Date: Fri, 28 Dec 2018 03:21:35 +0800 Subject: [PATCH 31/35] Fixed typo in Sonoff R2 Cover example (#112) --- esphomeyaml/cookbook/dual-r2-cover.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphomeyaml/cookbook/dual-r2-cover.rst b/esphomeyaml/cookbook/dual-r2-cover.rst index 1f2f5517f..72203bc46 100644 --- a/esphomeyaml/cookbook/dual-r2-cover.rst +++ b/esphomeyaml/cookbook/dual-r2-cover.rst @@ -10,7 +10,7 @@ The following is a possible configuration file for common covers that use a moto Only one should be powered at a time (interlocking) to either move the cover up or down. For this the `Sonoff Dual R2 `__ can be used which has two independent relays. Additionally this configuration allows the single button on the Sonoff to control the motion -by cycling between: open->stop->down->stop->... +by cycling between: open->stop->close->stop->... These kind of motors automatically stop when the end of the cover movement is reached. However, to be safe, this automation stops powering the motor after 1 minute of movement. In the rare case From 013d00bc4cb19bf2361ef0967f2999d22d81af6f Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 31 Dec 2018 13:17:43 +0100 Subject: [PATCH 32/35] Privacy Policy --- _templates/layout.html | 16 +++++ conf.py | 5 +- index.rst | 1 + misc/index.rst | 7 +++ misc/privacy.rst | 129 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 _templates/layout.html create mode 100644 misc/index.rst create mode 100644 misc/privacy.rst diff --git a/_templates/layout.html b/_templates/layout.html new file mode 100644 index 000000000..051d4c323 --- /dev/null +++ b/_templates/layout.html @@ -0,0 +1,16 @@ +{% extends 'alabaster/layout.html' %} + +{% block footer %} + + + + +{% endblock %} diff --git a/conf.py b/conf.py index 2a99f764a..23f7be8a8 100644 --- a/conf.py +++ b/conf.py @@ -69,6 +69,7 @@ master_doc = 'index' project = 'esphomelib' copyright = '2018, Otto Winter' html_show_copyright = False +html_show_sphinx = False author = 'Otto Winter' # The version info for the project you're documenting, acts as replacement for @@ -117,6 +118,7 @@ html_theme = 'alabaster' # further. For a list of options available for each theme, see the # documentation. # +html_baseurl = os.getenv('BASE_URL', 'https://esphomelib.com') html_theme_options = { # 'logo': 'logo-full.png', 'logo_name': False, @@ -126,6 +128,8 @@ html_theme_options = { 'show_related': False, 'sidebar_collapse': True, 'fixed_sidebar': True, + 'show_powered_by': False, + 'canonical_url': html_baseurl + '/', } html_logo = '_static/logo-full.png' @@ -211,5 +215,4 @@ texinfo_documents = [ author, 'esphomelib', 'One line description of project.', 'Miscellaneous'), ] -html_baseurl = os.getenv('BASE_URL', 'https://esphomelib.com') linkcheck_ignore = [r'https://github.com/.*', r'https://discord.gg/.*'] diff --git a/index.rst b/index.rst index 4f2a5791c..52a0635ee 100644 --- a/index.rst +++ b/index.rst @@ -58,3 +58,4 @@ Features esphomeyaml/index web-api/index api/index + misc/index diff --git a/misc/index.rst b/misc/index.rst new file mode 100644 index 000000000..f67cb0a1f --- /dev/null +++ b/misc/index.rst @@ -0,0 +1,7 @@ +Misc +==== + +.. toctree:: + :glob: + + * diff --git a/misc/privacy.rst b/misc/privacy.rst new file mode 100644 index 000000000..976fd9a4c --- /dev/null +++ b/misc/privacy.rst @@ -0,0 +1,129 @@ +Privacy Policy +============== + +*Effective date: December 31, 2018* + +The esphomelib team ("us", "we", or "our") operates the https://esphomelib.com/ and https://esphome.io/ website +(the "Service"). + +This page informs you of our policies regarding the collection, use, and disclosure of personal data when you use +our Service and the choices you have associated with that data. + +We will not use or share your information with anyone except as described in this Privacy Policy. + +Information Collection And Use +------------------------------ + +We collect several different types of information for various purposes to provide and improve our Service to you. + +We may also collect information how the Service is accessed and used ("Usage Data"). This Usage Data may include +information such as your computer's Internet Protocol address (e.g. IP address), browser type, +browser version, the pages of our Service that you visit, the time and date of your visit, +the time spent on those pages, unique device identifiers and other diagnostic data. + +From time to time, we may release non-personally-identifying information in the aggregate, +e.g., by publishing a report on trends in the usage of our website. + +In addition, we may use third party services such as Google Analytics that collect, monitor and analyze +this type of information in order to increase our Service's functionality. These third party +service providers have their own privacy policies addressing how they use such information. + +Gathering of Personally-Identifying Information +----------------------------------------------- + +Certain visitors to our websites choose to interact with us in ways that require us to gather personally-identifying +information. The amount and type of information that we gather depends on the nature of the interaction. +For example, we ask visitors who create a forum account to provide a username and an email address. +Those who engage in transactions with us are asked to provide additional information, including as necessary the +personal and financial information required to process those transactions. In each case, we collect such information +only insofar as is necessary or appropriate to fulfill the purpose of the visitor’s interaction. Visitors can always +refuse to supply personally-identifying information, with the caveat that it may prevent them from engaging in certain +website-related activities. + +Service Providers +----------------- + +We may employ third party companies and individuals to facilitate our Service, to provide the Service on our behalf, +to perform Service-related services or to assist us in analyzing how our Service is used. + +Google Analytics +**************** + +Google Analytics is a web analytics service offered by Google that tracks and reports website traffic. +Google uses the data collected to track and monitor the use of our Service. This data is shared with other Google +services. Google may use the collected data to contextualize and personalize the ads of its own advertising network. + +You can opt-out of having made your activity on the Service available to Google Analytics by installing the +Google Analytics opt-out browser add-on (see http://tools.google.com/dlpage/gaoptout). +The add-on prevents the Google Analytics JavaScript (ga.js, analytics.js, and dc.js) from sharing information with Google Analytics about visits activity. + +This website uses the anonymize IP function to crop your IP address in accordance with the IP masking requirements +of EU privacy laws. This means that your IP address is shortened so that it can not be used to identify you +and is no longer considered Personal Information. + +For more information on the privacy practices of Google, please visit the Google Privacy & Terms web page: https://policies.google.com/privacy?hl=en + +Cloudflare +********** + +The Internet presence of this company is provided by the technology partner CloudFlare Inc., based in the USA. +All data passed to or from this website pass through the worldwide network of CloudFlare, Inc. + +For more information, see CloudFlare's Privacy Statement at: +https://www.cloudflare.com/security-policy/ + +GitHub Pages +************ + +Our website is served through the GitHub pages service, operated by GitHub Inc., based in the USA. + +For more information, see GitHub's Privacy Statement at: +https://help.github.com/articles/github-privacy-statement/ + +Disqus +****** + +Our website uses the comment system provided by `Disqus `__ to enable commenting +on pages directly under the page content. On all pages with a comment section, disqus may track you across website +visits. When you choose to add a comment, you will additionally be asked to log in to your disqus account +with your personal information. We're committed to your privacy, therefore all settings related to tracking +by Disqus have been disabled for our websites. + +For more information, see Disqus's Privacy Statement at: +https://help.disqus.com/terms-and-policies/disqus-privacy-policy + +Cookies +------- + +A cookie is a string of information that a website stores on a visitor’s computer, and that the visitor’s browser +provides to the website each time the visitor returns. We uses cookies to help us identify and track visitors, +their usage of our website, and their website access preferences. Visitors who do not wish to have cookies placed +on their computers should set their browsers to refuse cookies before using our websites, with the drawback that +certain features of our websites may not function properly without the aid of cookies. + +Links To Other Sites +-------------------- + +Our Service may contain links to other sites that are not operated by us. If you click on a third party link, +you will be directed to that third party's site. We strongly advise you to review the Privacy Policy of +every site you visit. + +We have no control over and assume no responsibility for the content, privacy policies or practices of any +third party sites or services. + +Changes To This Privacy Policy +------------------------------ + +We may update our Privacy Policy from time to time. We will notify you of any changes by posting the new +Privacy Policy on this page. + +We will let you know via a prominent notice on our Service, prior to the change becoming effective and update +the "effective date" at the top of this Privacy Policy. + +You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective +when they are posted on this page. + +Contact Us +---------- + +If you have any questions about this Privacy Policy, please contact us by email: contact@otto-winter.com From c560bc4d662b9596c301ade7064a1614e25966e1 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Wed, 2 Jan 2019 14:49:02 +0100 Subject: [PATCH 33/35] Upgrade footer --- _static/custom.css | 32 +++++++++++++++++++++++++++++++- _templates/layout.html | 16 ++++++++++++++++ conf.py | 10 +++++----- 3 files changed, 52 insertions(+), 6 deletions(-) diff --git a/_static/custom.css b/_static/custom.css index ebc6d01c6..ef28810f1 100644 --- a/_static/custom.css +++ b/_static/custom.css @@ -45,4 +45,34 @@ table.docutils { 100% { visibility: visible; } -} \ No newline at end of file +} + +#upgrade-footer { + position: fixed; + left: 0; + bottom: 0; + right: 0; + width: 100%; + background-color: rgba(20,20,20,0.8); + min-height: 26px; + font-size: 14px; + color: #ccc; + line-height: 26px; + padding: 8px 0 8px 30px; + z-index: 9999; + display: none +} +#upgrade-footer-changelog { + background-color: #b3b3b3; + color: #4e4e4e; + display: inline-block; + border-radius: 5px; + padding: 0 20px; + cursor: pointer; + float: right; + margin: 0 60px 0 10px; + text-decoration: none; +} +.not-hidden { + display: block !important; +} diff --git a/_templates/layout.html b/_templates/layout.html index 051d4c323..67f72ca51 100644 --- a/_templates/layout.html +++ b/_templates/layout.html @@ -4,6 +4,10 @@ + + + {% endblock %} diff --git a/conf.py b/conf.py index 23f7be8a8..190b90388 100644 --- a/conf.py +++ b/conf.py @@ -66,8 +66,8 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = 'esphomelib' -copyright = '2018, Otto Winter' +project = 'ESPHome' +copyright = '2019, Otto Winter' html_show_copyright = False html_show_sphinx = False author = 'Otto Winter' @@ -188,7 +188,7 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'esphomelib.tex', 'esphomelib Documentation', + (master_doc, 'esphomelib.tex', 'ESPHome Documentation', 'Otto Winter', 'manual'), ] @@ -200,7 +200,7 @@ latex_engine = 'xelatex' # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'esphomelib', 'esphomelib Documentation', + (master_doc, 'esphomelib', 'ESPHome Documentation', [author], 1) ] @@ -211,7 +211,7 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'esphomelib', 'esphomelib Documentation', + (master_doc, 'esphomelib', 'ESPHome Documentation', author, 'esphomelib', 'One line description of project.', 'Miscellaneous'), ] From b0737113e50114eceeba5d59fa5b3441b5722093 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Wed, 2 Jan 2019 15:39:34 +0100 Subject: [PATCH 34/35] Remove line --- .github/PULL_REQUEST_TEMPLATE.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f31f76f87..5012a00c4 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -9,4 +9,3 @@ ## Checklist: - [ ] The documentation change has been tested and compiles correctly. - [ ] Branch: `next` is for changes and new documentation that will go public with the next esphomelib release. Fixes, changes and adjustments for the current release should be created against `current`. - - [ ] Check this box if you have read, understand, comply, and agree with the [Code of Conduct](https://github.com/OttoWinter/esphomedocs/blob/master/CODE_OF_CONDUCT.md). From a54ad5c291010ebbe807799503e39fd2cf863698 Mon Sep 17 00:00:00 2001 From: wutr <13820537+wutr@users.noreply.github.com> Date: Wed, 2 Jan 2019 14:39:46 +0000 Subject: [PATCH 35/35] Fix copy/paste error in turn_off_action (#113) --- esphomeyaml/components/switch/template.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphomeyaml/components/switch/template.rst b/esphomeyaml/components/switch/template.rst index 69350c5b0..9d62ede9a 100644 --- a/esphomeyaml/components/switch/template.rst +++ b/esphomeyaml/components/switch/template.rst @@ -47,7 +47,7 @@ Configuration variables: - **turn_on_action** (*Optional*, :ref:`Action `): The action that should be performed when the remote (like Home Assistant's frontend) requests the switch to be turned on. - **turn_off_action** (*Optional*, :ref:`Action `): The action that should - be performed when the remote (like Home Assistant's frontend) requests the switch to be turned on. + be performed when the remote (like Home Assistant's frontend) requests the switch to be turned off. - **restore_state** (*Optional*, boolean): Sets whether esphomelib should attempt to restore the state on boot-up and call the turn on/off actions with the recovered values. Defaults to ``yes``. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.