From 5bc1980e5f0f1fde004196390e4c500f6347558a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Tue, 27 Feb 2018 10:41:15 +0100 Subject: [PATCH] ECH1560 call _sync from tick method --- README.md | 6 +++--- code/espurna/sensors/ECH1560Sensor.h | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b77a343b..ca8c4d34 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ ESPurna ("spark" in Catalan) is a custom firmware for ESP8266 based smart switch It uses the Arduino Core for ESP8266 framework and a number of 3rd party libraries. [![version](https://img.shields.io/badge/version-1.12.4a-brightgreen.svg)](CHANGELOG.md) -![branch](https://img.shields.io/badge/branch-dev-orange.svg) -[![travis](https://travis-ci.org/xoseperez/espurna.svg?branch=dev)](https://travis-ci.org/xoseperez/espurna) -[![codacy](https://img.shields.io/codacy/grade/c9496e25cf07434cba786b462cb15f49/dev.svg)](https://www.codacy.com/app/xoseperez/espurna/dashboard) +![branch](https://img.shields.io/badge/branch-sensors-orange.svg) +[![travis](https://travis-ci.org/xoseperez/espurna.svg?branch=sensors)](https://travis-ci.org/xoseperez/espurna) +[![codacy](https://img.shields.io/codacy/grade/c9496e25cf07434cba786b462cb15f49/sensors.svg)](https://www.codacy.com/app/xoseperez/espurna/dashboard) [![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=xose%2eperez%40gmail%2ecom&lc=US&no_note=0¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHostedGuest) [![twitter](https://img.shields.io/twitter/follow/xoseperez.svg?style=social)](https://twitter.com/intent/follow?screen_name=xoseperez) diff --git a/code/espurna/sensors/ECH1560Sensor.h b/code/espurna/sensors/ECH1560Sensor.h index 0de3efc3..8ffc07a4 100644 --- a/code/espurna/sensors/ECH1560Sensor.h +++ b/code/espurna/sensors/ECH1560Sensor.h @@ -75,6 +75,11 @@ class ECH1560Sensor : public BaseSensor { } + // Loop-like method, call it in your main loop + void tick() { + if (_dosync) _sync(); + } + // Descriptive name of the sensor String description() { char buffer[25];