From 4eb0c2d930b6fdcb97dd3d84904918e97ab5cb2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=B6sch?= Date: Fri, 8 Jan 2021 23:42:58 +0100 Subject: [PATCH 1/4] DS1307 real time clock component (#910) * add DS1307 documentation * add sync to/from rtc actions * changed action names * reformat action documentation * cleanup lint * link actions --- components/time.rst | 74 +++++++++++++++++++++++++++++++++++++++++- guides/automations.rst | 2 ++ 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/components/time.rst b/components/time.rst index 643ebfe4a..6dbb927da 100644 --- a/components/time.rst +++ b/components/time.rst @@ -88,6 +88,78 @@ Configuration variables: - **on_time** (*Optional*, :ref:`Automation `): Automation to run at specific intervals using a cron-like syntax. See :ref:`time-on_time`. +DS1307 Time Source +------------------ + +You first need to set up the :doc:`I2C ` component. + +.. code-block:: yaml + + # Example configuration entry + time: + - platform: ds1307 + id: ds1307_time + +Configuration variables: + +- **id** (*Optional*, :ref:`config-id`): Specify the ID of the time for use in lambdas. +- **address** (*Optional*, int): Manually specify the I²C address of the RTC. Defaults to ``0x68``. +- **timezone** (*Optional*, string): Manually tell ESPHome what time zone to use with `this format + `__ (warning: the format is quite complicated) + or the simpler `TZ database name `__ in the form + /. ESPHome tries to automatically infer the time zone string based on the time zone of the computer + that is running ESPHome, but this might not always be accurate. +- **on_time** (*Optional*, :ref:`Automation `): Automation to run at specific intervals using + a cron-like syntax. See :ref:`time-on_time`. + +DS1307 Actions +-------------- + +The DS1307 component supports :ref:`actions ` that can be used to synchronize the RTC hardware and +the system clock. + +.. _ds1307-write_action: + +``ds1307.write`` Action +*********************** + +This :ref:`Action ` triggers a synchronization of the current system time to the RTC hardware. + +.. note:: + + The DS1307 component will *not* write the RTC clock if not triggered *explicitely* by this action. + +.. code-block:: yaml + + on_...: + - ds1307.write + + # in case you need to specify the DS1307 id + - ds1307.write: + id: ds1307_time + +.. _ds1307-read_action: + +``ds1307.read`` Action +********************** + +This :ref:`Action ` triggers a synchronization of the current system time from the RTC hardware. + +.. note:: + + The DS1307 component will automatically read the RTC clock every 15 minutes by default and synchronize the + system clock when a valid timestamp was read from the RTC. (The ``update_interval`` can be changed.) + This action can be used to trigger *additional* synchronizations. + +.. code-block:: yaml + + on_...: + - ds1307.read + + # in case you need to specify the DS1307 id + - ds1307.read: + id: ds1307_time + Use In Lambdas -------------- @@ -142,7 +214,7 @@ created based on a given format. If you want to get the current time attributes, .. _strftime: strftime -^^^^^^^^ +******** The second way to use the time object is to directly transform it into a string like ``2018-08-16 16:31``. This is directly done using C's `strftime `__ function which diff --git a/guides/automations.rst b/guides/automations.rst index 589c5b8b7..66c8c298a 100644 --- a/guides/automations.rst +++ b/guides/automations.rst @@ -374,6 +374,8 @@ All Actions - :ref:`http_request.get ` / :ref:`http_request.post ` / :ref:`http_request.send ` - :ref:`rf_bridge.send_code ` - :ref:`rf_bridge.learn ` +- :ref:`ds1307.read ` +- :ref:`ds1307.write ` .. _config-condition: From 6eec11e429e91c602ad27851f3db9ea108310873 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 11 Jan 2021 20:10:39 +1300 Subject: [PATCH 2/4] Bump version to v1.16.0b2 --- Doxygen | 2 +- Makefile | 2 +- _static/version | 2 +- conf.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doxygen b/Doxygen index ca9712e4f..3176ee909 100644 --- a/Doxygen +++ b/Doxygen @@ -38,7 +38,7 @@ PROJECT_NAME = "ESPHome" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.16.0b1 +PROJECT_NUMBER = 1.16.0b2 # 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 0fa780152..03f854107 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ ESPHOME_PATH = ../esphome -ESPHOME_REF = v1.16.0b1 +ESPHOME_REF = v1.16.0b2 .PHONY: html html-strict cleanhtml deploy help webserver Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png diff --git a/_static/version b/_static/version index b98f4f2b6..8c412317b 100644 --- a/_static/version +++ b/_static/version @@ -1 +1 @@ -1.16.0b1 \ No newline at end of file +1.16.0b2 \ No newline at end of file diff --git a/conf.py b/conf.py index d2bf90c8b..6de947d08 100644 --- a/conf.py +++ b/conf.py @@ -72,7 +72,7 @@ author = 'Otto Winter' # The short X.Y version. version = '1.16' # The full version, including alpha/beta/rc tags. -release = '1.16.0b1' +release = '1.16.0b2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From d1f2378356a9d72efd40a204342f9227bb8f84d9 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 11 Jan 2021 20:15:26 +1300 Subject: [PATCH 3/4] Update changelog for 1.16.0b2 --- changelog/v1.16.0.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/changelog/v1.16.0.rst b/changelog/v1.16.0.rst index 17bc2eccd..bece9cf6e 100644 --- a/changelog/v1.16.0.rst +++ b/changelog/v1.16.0.rst @@ -230,3 +230,8 @@ All changes - esphome: Bump platformio from 5.0.3 to 5.0.4 :esphomepr:`1444` by :ghuser:`dependabot[bot]` - esphome: Fix SN74HC595 with optional OE pin :esphomepr:`1454` by :ghuser:`rradar` - esphome: Fix stepper half half step mode :esphomepr:`1397` by :ghuser:`Fractal147` +- esphome: fix safe_mode :esphomepr:`1421` by :ghuser:`alexyao2015` +- esphome: DS1307 real time clock component :esphomepr:`1441` by :ghuser:`badbadc0ffee` (new-integration) +- docs: DS1307 real time clock component :docspr:`910` by :ghuser:`badbadc0ffee` +- esphome: Add encode_uint32 method, similar to encode_uint16 :esphomepr:`1427` by :ghuser:`e28eta` +- esphome: Rotary Encoder: Don't call callbacks in the isr :esphomepr:`1456` by :ghuser:`mknjc` From f4c1ad2d4d26c6bf80bbc5a66fe960843f66563b Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 11 Jan 2021 20:15:40 +1300 Subject: [PATCH 4/4] Update supporters for 1.16.0b2 --- guides/supporters.rst | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/guides/supporters.rst b/guides/supporters.rst index 7e362eee9..c4b264cc0 100644 --- a/guides/supporters.rst +++ b/guides/supporters.rst @@ -124,7 +124,7 @@ Contributors - `Alexander Leisentritt (@Alex9779) `__ - 10 contributions - `Alexandre Danault (@AlexDanault) `__ - 1 contribution - `Alex Mekkering (@AlexMekkering) `__ - 3 contributions -- `Alex (@alexyao2015) `__ - 2 contributions +- `Alex (@alexyao2015) `__ - 3 contributions - `Amish Vishwakarma (@amishv) `__ - 3 contributions - `András Bíró (@andrasbiro) `__ - 1 contribution - `Andreas Hergert (@andreashergert1984) `__ - 1 contribution @@ -140,7 +140,7 @@ Contributors - `Achilleas Pipinellis (@axilleas) `__ - 1 contribution - `Kamil Trzciński (@ayufan) `__ - 7 contributions - `Nicholas Peters (@Azimath) `__ - 2 contributions -- `Florian Mösch (@badbadc0ffee) `__ - 4 contributions +- `Florian Mösch (@badbadc0ffee) `__ - 5 contributions - `balk77 (@balk77) `__ - 2 contributions - `Paulus Schoutsen (@balloob) `__ - 41 contributions - `Andrew Zaborowski (@balrog-kun) `__ - 7 contributions @@ -208,6 +208,7 @@ Contributors - `dubit0 (@dubit0) `__ - 1 contribution - `Dimitris Zervas (@dzervas) `__ - 1 contribution - `dziobson (@dziobson) `__ - 1 contribution +- `Dan Jackson (@e28eta) `__ - 1 contribution - `Ermanno Baschiera (@ebaschiera) `__ - 1 contribution - `Niclas Larsson (@edge90) `__ - 1 contribution - `Eenoo (@Eenoo) `__ - 1 contribution @@ -226,12 +227,13 @@ Contributors - `Eric Hiller (@erichiller) `__ - 1 contribution - `Ernst Klamer (@Ernst79) `__ - 1 contribution - `escoand (@escoand) `__ - 7 contributions -- `esphomebot (@esphomebot) `__ - 5 contributions +- `esphomebot (@esphomebot) `__ - 6 contributions - `Evan Coleman (@evandcoleman) `__ - 3 contributions - `Malte Franken (@exxamalte) `__ - 2 contributions - `Fabian Affolter (@fabaff) `__ - 28 contributions - `C W (@fake-name) `__ - 2 contributions - `Christian Ferbar (@ferbar) `__ - 2 contributions +- `Fractal147 (@Fractal147) `__ - 1 contribution - `Francis-labo (@Francis-labo) `__ - 1 contribution - `Francisk0 (@Francisk0) `__ - 1 contribution - `Frank Bakker (@FrankBakkerNl) `__ - 2 contributions @@ -281,7 +283,7 @@ Contributors - `Joshua Dadswell (@jdads1) `__ - 1 contribution - `jeff-h (@jeff-h) `__ - 2 contributions - `Jeff Rescignano (@JeffResc) `__ - 11 contributions -- `Jesse Hills (@jesserockz) `__ - 50 contributions +- `Jesse Hills (@jesserockz) `__ - 52 contributions - `Jonathan Jefferies (@jjok) `__ - 1 contribution - `Jeppe Ladefoged (@jladefoged) `__ - 2 contributions - `Jonathan Martens (@jmartens) `__ - 1 contribution @@ -359,6 +361,7 @@ Contributors - `Matthew Edwards (@mje-nz) `__ - 1 contribution - `Maarten (@mjkl-gh) `__ - 1 contribution - `mjoshd (@mjoshd) `__ - 2 contributions +- `mknjc (@mknjc) `__ - 1 contribution - `mnaz (@mnaz) `__ - 1 contribution - `Michael Nieß (@mniess) `__ - 1 contribution - `Matt N. (@mnoorenberghe) `__ - 1 contribution @@ -434,7 +437,7 @@ Contributors - `RockBomber (@RockBomber) `__ - 1 contribution - `Jérôme W. (@RomRider) `__ - 1 contribution - `Robbie Page (@rorpage) `__ - 1 contribution -- `rradar (@rradar) `__ - 5 contributions +- `rradar (@rradar) `__ - 6 contributions - `rspaargaren (@rspaargaren) `__ - 5 contributions - `Rubén G. (@rubengargar) `__ - 1 contribution - `rudgr (@rudgr) `__ - 1 contribution @@ -527,4 +530,4 @@ Contributors - `ZabojnikM (@ZabojnikM) `__ - 1 contribution - `San (@zhujunsan) `__ - 1 contribution -*This page was last updated January 7, 2021.* +*This page was last updated January 11, 2021.*