From b3788a5f8daf28e9b6ba29cfbea27fc863334af4 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Fri, 19 Feb 2021 13:54:13 +0100 Subject: [PATCH 01/15] fix ili9342 --- lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp | 13 ++++++++----- tasmota/xdsp_04_ili9341.ino | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp b/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp index 808c60362..851a5d208 100644 --- a/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp +++ b/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp @@ -175,7 +175,7 @@ void ILI9341_2::writecmd(uint8_t d) { void ILI9341_2::init(uint16_t width, uint16_t height) { //sspi2 = SPISettings(2500000, MSBFIRST, SPI_MODE3); - if (_hwspi == 2) { + if (_hwspi >= 2) { iwidth = ILI9341_TFTWIDTH; iheight = ILI9341_TFTHEIGHT; } else { @@ -187,8 +187,11 @@ void ILI9341_2::init(uint16_t width, uint16_t height) { sspi2 = SPISettings(40000000, MSBFIRST, SPI_MODE0); - if (_hwspi==2) { - spi2=&SPI; + if (_hwspi >= 2) { + spi2 = &SPI; + if (_hwspi > 2) { + spi2->begin(_sclk, _miso, _mosi, -1); + } } else { #ifdef ESP32 if (_spibus == 2) { @@ -522,7 +525,7 @@ void ili9342_bpwr(uint8_t on); void ILI9341_2::DisplayOnff(int8_t on) { - if (_hwspi==2) { + if (_hwspi>=2) { ili9342_bpwr(on); } @@ -572,7 +575,7 @@ void ILI9341_2::dim(uint8_t dim) { if (_bp>=0) { ledcWrite(ESP32_PWM_CHANNEL,dimmer); } else { - if (_hwspi==2) { + if (_hwspi>=2) { ili9342_dimm(dim); } } diff --git a/tasmota/xdsp_04_ili9341.ino b/tasmota/xdsp_04_ili9341.ino index ca06dc244..2b1a31a73 100644 --- a/tasmota/xdsp_04_ili9341.ino +++ b/tasmota/xdsp_04_ili9341.ino @@ -65,7 +65,7 @@ void ILI9341_InitDriver() #ifdef USE_DISPLAY_ILI9341 uint8_t dtype = 1; #else - uint8_t dtype = 2; + uint8_t dtype = 3; // sign ili9342 with variable spi pins #endif // USE_DISPLAY_ILI9341 // default colors From 66788c0383800f1c56c9f3ba17b9a798e4e4523c Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Fri, 19 Feb 2021 14:10:09 +0100 Subject: [PATCH 02/15] Update ILI9341_2.cpp --- lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp b/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp index 851a5d208..ebf828790 100644 --- a/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp +++ b/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp @@ -189,9 +189,11 @@ void ILI9341_2::init(uint16_t width, uint16_t height) { if (_hwspi >= 2) { spi2 = &SPI; +#ifdef ESP32 if (_hwspi > 2) { spi2->begin(_sclk, _miso, _mosi, -1); } +#endif // ESP32 } else { #ifdef ESP32 if (_spibus == 2) { From cabfc4f6993399c71996403ece13ce00510a72e5 Mon Sep 17 00:00:00 2001 From: Simon Hailes Date: Fri, 19 Feb 2021 13:35:39 +0000 Subject: [PATCH 03/15] Fix HASS discovery for MI sensors - workaround is to use 'mi32option6 1' --- tasmota/xsns_62_esp32_mi_ble.ino | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tasmota/xsns_62_esp32_mi_ble.ino b/tasmota/xsns_62_esp32_mi_ble.ino index 44a475942..ad9771f76 100644 --- a/tasmota/xsns_62_esp32_mi_ble.ino +++ b/tasmota/xsns_62_esp32_mi_ble.ino @@ -1937,13 +1937,24 @@ void MI32Every50mSecond(){ void MI32EverySecond(bool restart){ +#ifdef USE_HOME_ASSISTANT + if(Settings.flag.hass_discovery){ + // fixes bug introduced - just by forcing this mode. + MI32.option.MQTTType = 1; + } +#endif + // AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("M32: onesec")); MI32TimeoutSensors(); if (MI32.option.MQTTType == 0){ + // show tas style sensor MQTT MI32ShowSomeSensors(); } else { + // these two share a counter + // discovery only sent if hass_discovery MI32DiscoveryOneMISensor(); + // show independent style sensor MQTT MI32ShowOneMISensor(); } From ec25cfb08c89d7dd1d4bfdea202f636e081b97c9 Mon Sep 17 00:00:00 2001 From: Simon Hailes Date: Fri, 19 Feb 2021 13:46:35 +0000 Subject: [PATCH 04/15] better bugfix for MI32Option6 bug --- tasmota/xsns_62_esp32_mi_ble.ino | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tasmota/xsns_62_esp32_mi_ble.ino b/tasmota/xsns_62_esp32_mi_ble.ino index ad9771f76..8b7b760ba 100644 --- a/tasmota/xsns_62_esp32_mi_ble.ino +++ b/tasmota/xsns_62_esp32_mi_ble.ino @@ -1937,24 +1937,25 @@ void MI32Every50mSecond(){ void MI32EverySecond(bool restart){ -#ifdef USE_HOME_ASSISTANT - if(Settings.flag.hass_discovery){ - // fixes bug introduced - just by forcing this mode. - MI32.option.MQTTType = 1; - } -#endif - // AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("M32: onesec")); MI32TimeoutSensors(); if (MI32.option.MQTTType == 0){ // show tas style sensor MQTT MI32ShowSomeSensors(); - } else { + } + + if (MI32.option.MQTTType == 1 +#ifdef USE_HOME_ASSISTANT + || + Settings.flag.hass_discovery +#endif + ) { // these two share a counter // discovery only sent if hass_discovery MI32DiscoveryOneMISensor(); // show independent style sensor MQTT + // note - if !MQTTType, then this is IN ADDITION to 'normal' MI32ShowOneMISensor(); } From 59c0ebd49edce4c10af93aaea587be1b41516a6b Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 19 Feb 2021 16:51:55 +0100 Subject: [PATCH 05/15] Bump version 9.3.0.1 --- CHANGELOG.md | 14 ++++-- FIRMWARE.md | 2 +- README.md | 2 +- RELEASENOTES.md | 93 ++------------------------------------- tasmota/tasmota_version.h | 2 +- 5 files changed, 17 insertions(+), 96 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 032b3e023..5c286ae9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,17 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - Development -## [9.2.0.7] +## [9.3.0.1] +### Fixed +- Ili1942 driver (#11046) +- ESP32 Mi32 driver (#11048) + +## [Released] + +## [9.3.0] 20210219 +- Release Kenneth + +## [9.2.0.7] 20210219 ### Added - Support for Device Groups Device Map (#10898) - Support for Eastron SDM72D-M three phase 100A Modbus energy meter (#10862) @@ -132,8 +142,6 @@ All notable changes to this project will be documented in this file. - Compile error when ``#ifdef USE_IR_RECEIVE`` is disabled regression from 9.1.0.2 - Prometheus memory leak (#10221) -## [Released] - ## [9.2.0] 20201216 - Release Julie diff --git a/FIRMWARE.md b/FIRMWARE.md index da20d75f9..e7c03c036 100644 --- a/FIRMWARE.md +++ b/FIRMWARE.md @@ -18,7 +18,7 @@ See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/tasmota/C ## Development -[![Dev Version](https://img.shields.io/badge/development%20version-v9.2.x.x-blue.svg)](https://github.com/arendst/Tasmota) +[![Dev Version](https://img.shields.io/badge/development%20version-v9.3.x.x-blue.svg)](https://github.com/arendst/Tasmota) [![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/) [![Tasmota CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22) [![Tasmota ESP32 CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20ESP32%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22) diff --git a/README.md b/README.md index 4b41da5cf..232c92565 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ In addition to the [release webpage](https://github.com/arendst/Tasmota/releases ## Development -[![Dev Version](https://img.shields.io/badge/development%20version-v9.2.x.x-blue.svg)](https://github.com/arendst/Tasmota) +[![Dev Version](https://img.shields.io/badge/development%20version-v9.3.x.x-blue.svg)](https://github.com/arendst/Tasmota) [![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/) [![Tasmota CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22) [![Tasmota ESP32 CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20ESP32%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 082ca49e7..d7775f601 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -78,94 +78,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota [Complete list](BUILDS.md) of available feature and sensors. -## Changelog v9.2.0.7 -### Added -- Command ``CTRange`` to specify the visible CT range the bulb is capable of [#10311](https://github.com/arendst/Tasmota/issues/10311) -- Command ``L1MusicSync <0|Off>|<1|On>|<2|Toggle>, 1..10, 1..100>`` to control Sonoff L1 Music Sync mode sensitivity and speed [#10722](https://github.com/arendst/Tasmota/issues/10722) -- Command ``RuleTimer0`` to access all RuleTimers at once [#10352](https://github.com/arendst/Tasmota/issues/10352) -- Command ``Speed2`` to control a once off fade [#10741](https://github.com/arendst/Tasmota/issues/10741) -- Command ``VirtualCT`` to simulate or fine tune CT bulbs with 3,4,5 channels [#10311](https://github.com/arendst/Tasmota/issues/10311) -- Command ``SetOption40 0..250`` to disable button functionality if activated for over 0.1 second re-introduced -- Command ``SetOption43 1..255`` to control Rotary step [#10407](https://github.com/arendst/Tasmota/issues/10407) -- Command ``SetOption118 1`` to move ZbReceived from JSON message and into the subtopic replacing "SENSOR" default [#10353](https://github.com/arendst/Tasmota/issues/10353) -- Command ``SetOption119 1`` to remove the device addr from json payload, can be used with zb_topic_fname where the addr is already known from the topic [#10355](https://github.com/arendst/Tasmota/issues/10355) -- Zigbee command ``SetOption120 1`` or ``ZbEndpointTopic 1`` to add the zigbee endpoint as suffix in topic when using ``SetOption89 1`` -- Zigbee command ``ZbScan`` to do an energy scan on each radio channel -- Commands ``ChannelRemap``, ``MultiPWM``, ``AlexaCTRange``, ``PowerOnFade``, ``PWMCT``, ``WhiteBlend`` and ``VirtualCT`` as synonyms for ``SetOption37, 68, 82, 91, 92, 105`` and ``106`` -- Commands ``ZbNameKey``, ``ZbDeviceTopic``, ``ZbNoPrefix``, ``ZbEndpointSuffix``, ``ZbNoAutoBind`` and ``ZbNameTopic`` as synonyms for ``SetOption83, 89, 100, 101, 110`` and ``112`` -- Commands ``ZbNoAutoBind``, ``ZbReceivedTopic`` and ``ZbOmitDevice`` as synonyms for ``SetOption116, 118`` and ``119`` -- Commands ``BuzzerActive`` and ``BuzzerPwm`` as synonyms for ``SetOption67`` and ``111`` -- Filesystem commands ``Ufs``, ``UfsType``, ``UfsSize``, ``UfsFree``, ``UfsDelete``, ``UfsRename`` and ``UfsRun`` -- Support for filesystem ``autoexec.bat`` to execute sequential commands like backlog -- Milliseconds to console output [#10152](https://github.com/arendst/Tasmota/issues/10152) -- Gpio ``Option_a1`` enabling PWM2 high impedance if powered off as used by Wyze bulbs [#10196](https://github.com/arendst/Tasmota/issues/10196) -- Rotary No Pullup GPIO selection ``Rotary A/B_n`` [#10407](https://github.com/arendst/Tasmota/issues/10407) -- BSSID and Signal Strength Indicator to GUI wifi scan result [#10253](https://github.com/arendst/Tasmota/issues/10253) -- Support for P9813 RGB Led MOSFET controller [#10104](https://github.com/arendst/Tasmota/issues/10104) -- Support for GPIO option selection -- Support for FTC532 8-button touch controller by Peter Franck [#10222](https://github.com/arendst/Tasmota/issues/10222) -- Support for BS814A-2 8-button touch buttons by Peter Franck [#10447](https://github.com/arendst/Tasmota/issues/10447) -- Support for up to 4 I2C SEESAW_SOIL Capacitance & Temperature sensors by Peter Franck [#10481](https://github.com/arendst/Tasmota/issues/10481) -- Support for TOF10120 time of flight sensor by Cyril Pawelko [#10190](https://github.com/arendst/Tasmota/issues/10190) -- Support for Afrikaans language translations by Christiaan Heerze -- Support for Frysk language translations by Christiaan Heerze -- Support for IR inverted leds using ``#define IR_SEND_INVERTED true`` [#10301](https://github.com/arendst/Tasmota/issues/10301) -- Support for disabling 38kHz IR modulation using ``#define IR_SEND_USE_MODULATION false`` [#10301](https://github.com/arendst/Tasmota/issues/10301) -- Support for SPI display driver for ST7789 TFT by Gerhard Mutz [#9037](https://github.com/arendst/Tasmota/issues/9037) -- Support for TM1637 seven segment display by Ajith Vasudevan [#10889](https://github.com/arendst/Tasmota/issues/10889) -- Support for time proportioned (``#define USE_TIMEPROP``) and optional PID (``#define USE_PID``) relay control [#10412](https://github.com/arendst/Tasmota/issues/10412) -- Support for 24/26/32/34 bit RFID Wiegand interface (D0/D1) by Sigurd Leuther [#3647](https://github.com/arendst/Tasmota/issues/3647) -- Support for SM2135 current selection using GPIO ``SM2135 DAT`` index [#10634](https://github.com/arendst/Tasmota/issues/10634) -- Support for Sugar Valley NeoPool Controller by Norbert Richter [#10637](https://github.com/arendst/Tasmota/issues/10637) -- Support for Device Groups Device Map [#10898](https://github.com/arendst/Tasmota/issues/10898) -- Support for Eastron SDM72D-M three phase 100A Modbus energy meter [#10862](https://github.com/arendst/Tasmota/issues/10862) -- Support for ESP32 ``Module 3`` Odroid Go 16MB binary tasmota32-odroidgo.bin [#8630](https://github.com/arendst/Tasmota/issues/8630) -- Support for ESP32 ``Module 5`` Wireless Tag Eth01 [#9496](https://github.com/arendst/Tasmota/issues/9496) -- Support for ESP32 ``Module 7`` M5stack core2 16MB binary tasmota32-core2.bin [#10635](https://github.com/arendst/Tasmota/issues/10635) -- Support for Berry language on ESP32 -- Support rotary encoder on Shelly Dimmer [#10407](https://github.com/arendst/Tasmota/issues/10407#issuecomment-756240920) -- Support character `#` to be replaced by `space`-character in command ``Publish`` topic [#10258](https://github.com/arendst/Tasmota/issues/10258) -- Support trailing silence in buzzer tune [#10694](https://github.com/arendst/Tasmota/issues/10694) -- Rule trigger string comparisons for EndsWith ``$>``, StartsWith ``$<`` and Contains ``$|`` [#10538](https://github.com/arendst/Tasmota/issues/10538) -- SPI display driver SSD1331 Color oled by Jeroen Vermeulen [#10376](https://github.com/arendst/Tasmota/issues/10376) -- Compile time option ``USE_MQTT_TLS_DROP_OLD_FINGERPRINT`` to drop old (less secure) TLS fingerprint -- ESP8266 Fallback to ``*.bin.gz`` binary when OTA upload of ``*.bin`` binary fails - -### Breaking Changed -- ESP32 switch from default SPIFFS to default LittleFS file system loosing current (zigbee) files -- Replaced MFRC522 13.56MHz rfid card reader GPIO selection from ``SPI CS`` by ``RC522 CS`` -- Replaced NRF24L01 GPIO selection from ``SPI CS`` by ``NRF24 CS`` and ``SPI DC`` by ``NRF24 DC`` -- Replaced ILI9341 GPIO selection from ``SPI CS`` by ``ILI9341 CS`` and ``SPI DC`` by ``ILI9341 DC`` -- Replaced ST7789 GPIO selection from ``SPI CS`` by ``ST7789 CS`` and ``SPI DC`` by ``ST7789 DC`` -- Replaced ILI9488 GPIO selection from ``SPI CS`` by ``ILI9488_CS`` -- Replaced EPaper29 GPIO selection from ``SPI CS`` by ``EPaper29 CS`` -- Replaced EPaper42 GPIO selection from ``SPI CS`` by ``EPaper42 CS`` -- Replaced SSD1351 GPIO selection from ``SPI CS`` by ``SSD1351 CS`` -- Replaced RA8876 GPIO selection from ``SPI CS`` by ``RA8876 CS`` - -### Changed -- Remove support for direct migration from versions before v8.1.0 (Doris) -- IRremoteESP8266 library from v2.7.14 to v2.7.15 -- NeoPixelBus library from v2.6.0 to v2.6.1.4 -- ILI9341 library from Adafruit_ILI9341-1.2.0-Tasmota-1.0 to ILI9341-gemu-1.0 -- Command ``Sleep 0`` removes any sleep from wifi modem except when ESP32 BLE is active -- Logging from heap to stack freeing 700 bytes RAM -- Disabled ``USE_LIGHT`` light support for ZBBridge saving 17.6kB [#10374](https://github.com/arendst/Tasmota/issues/10374) -- Force initial default state ``SetOption57 1`` to scan wifi network every 44 minutes for strongest signal [#10395](https://github.com/arendst/Tasmota/issues/10395) -- PubSubClient MQTT_SOCKET_TIMEOUT from 15 to 4 seconds -- Domoticz fixed 2 decimals resolution by user selectable ``TempRes``, ``HumRes`` and ``PressRes`` resolutions -- Increase number of button GPIOs from 4 to 8 -- ESP32 Increase number of switch GPIOs from 8 to 28 -- ESP32 increase number of relay GPIOs from 8 to 28 -- ESP32 Increase number of interlock groups from 4 to 14 - +## Changelog v9.3.0.1 ### Fixed -- Redesign syslog and mqttlog using log buffer [#10164](https://github.com/arendst/Tasmota/issues/10164) -- Shutter stop issue [#10170](https://github.com/arendst/Tasmota/issues/10170) -- Scripter script_sub_command [#10181](https://github.com/arendst/Tasmota/issues/10181) -- Scripter JSON variable above 32 chars [#10193](https://github.com/arendst/Tasmota/issues/10193) -- Shelly Dimmer power on state [#10154](https://github.com/arendst/Tasmota/issues/10154) [#10182](https://github.com/arendst/Tasmota/issues/10182) -- Wemo emulation for single devices [#10165](https://github.com/arendst/Tasmota/issues/10165) [#10194](https://github.com/arendst/Tasmota/issues/10194) -- ESP32 LoadStoreError when using ``#define USER_TEMPLATE`` [#9506](https://github.com/arendst/Tasmota/issues/9506) -- Compile error when ``#ifdef USE_IR_RECEIVE`` is disabled regression from 9.1.0.2 -- Prometheus memory leak [#10221](https://github.com/arendst/Tasmota/issues/10221) +- Ili1942 driver [#11046](https://github.com/arendst/Tasmota/issues/11046) +- ESP32 Mi32 driver [#11048](https://github.com/arendst/Tasmota/issues/11048) diff --git a/tasmota/tasmota_version.h b/tasmota/tasmota_version.h index ec0ef2dcf..ce1ad81f9 100644 --- a/tasmota/tasmota_version.h +++ b/tasmota/tasmota_version.h @@ -20,6 +20,6 @@ #ifndef _TASMOTA_VERSION_H_ #define _TASMOTA_VERSION_H_ -const uint32_t VERSION = 0x09020007; +const uint32_t VERSION = 0x09030001; #endif // _TASMOTA_VERSION_H_ From 1b79ae59f2bfa7e2fcf252a17c9d3e1e65b91299 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 19 Feb 2021 16:54:39 +0100 Subject: [PATCH 06/15] Remove VirtualCT synonym --- tasmota/i18n.h | 1 - tasmota/xdrv_04_light.ino | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tasmota/i18n.h b/tasmota/i18n.h index 1c5c9b588..0edd337fa 100644 --- a/tasmota/i18n.h +++ b/tasmota/i18n.h @@ -433,7 +433,6 @@ #define D_SO_POWERONFADE "PowerOnFade" // SO91 #define D_SO_PWMCT "PWMCT" // SO92 #define D_SO_WHITEBLEND "WhiteBlend" // SO105 -#define D_SO_VIRTUALCT "VirtualCT" // SO106 #define D_CMND_CHANNEL "Channel" #define D_CMND_COLOR "Color" #define D_CMND_COLORTEMPERATURE "CT" diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino index 0144d826d..f60a6bdbd 100644 --- a/tasmota/xdrv_04_light.ino +++ b/tasmota/xdrv_04_light.ino @@ -131,7 +131,7 @@ const uint8_t LIGHT_COLOR_SIZE = 25; // Char array scolor size const char kLightCommands[] PROGMEM = "|" // No prefix // SetOptions synonyms D_SO_CHANNELREMAP "|" D_SO_MULTIPWM "|" D_SO_ALEXACTRANGE "|" D_SO_POWERONFADE "|" D_SO_PWMCT "|" - D_SO_WHITEBLEND "|" D_SO_VIRTUALCT "|" + D_SO_WHITEBLEND "|" // Other commands D_CMND_COLOR "|" D_CMND_COLORTEMPERATURE "|" D_CMND_DIMMER "|" D_CMND_DIMMER_RANGE "|" D_CMND_DIMMER_STEP "|" D_CMND_LEDTABLE "|" D_CMND_FADE "|" D_CMND_RGBWWTABLE "|" D_CMND_SCHEME "|" D_CMND_SPEED "|" D_CMND_WAKEUP "|" D_CMND_WAKEUPDURATION "|" @@ -150,7 +150,7 @@ const char kLightCommands[] PROGMEM = "|" // No prefix SO_SYNONYMS(kLightSynonyms, 37, 68, 82, 91, 92, - 105, 106, + 105, ); void (* const LightCommand[])(void) PROGMEM = { From 92b8c8ad48d41eee3093195e692c374cd55fa0cd Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 19 Feb 2021 18:35:47 +0100 Subject: [PATCH 07/15] Remove the need to start filenames with a slash (/) in Ufs commands --- CHANGELOG.md | 4 ++++ RELEASENOTES.md | 4 ++++ tasmota/xdrv_50_filesystem.ino | 29 ++++++++++++++++++++++------- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c286ae9f..48cd42700 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - Development ## [9.3.0.1] +### Changed +- Remove the need to start filenames with a slash (/) in Ufs commands +- Removed command ``VirtualCT`` as synonym for ``SetOption106`` (#11049) + ### Fixed - Ili1942 driver (#11046) - ESP32 Mi32 driver (#11048) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index d7775f601..8df5b85cc 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -79,6 +79,10 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota [Complete list](BUILDS.md) of available feature and sensors. ## Changelog v9.3.0.1 +### Changed +- Remove the need to start filenames with a slash (/) in Ufs commands +- Removed command ``VirtualCT`` as synonym for ``SetOption106`` [#11049](https://github.com/arendst/Tasmota/issues/11049) + ### Fixed - Ili1942 driver [#11046](https://github.com/arendst/Tasmota/issues/11046) - ESP32 Mi32 driver [#11048](https://github.com/arendst/Tasmota/issues/11048) diff --git a/tasmota/xdrv_50_filesystem.ino b/tasmota/xdrv_50_filesystem.ino index 2ed092618..3a5626cfb 100644 --- a/tasmota/xdrv_50_filesystem.ino +++ b/tasmota/xdrv_50_filesystem.ino @@ -426,6 +426,14 @@ bool UfsExecuteCommandFile(const char *fname) { * Commands \*********************************************************************************************/ +const int UFS_FILENAME_SIZE = 48; + +char* UfsFilename(char* fname, char* fname_in) { + fname_in = Trim(fname_in); // Remove possible leading spaces + snprintf_P(fname, UFS_FILENAME_SIZE, PSTR("%s%s"), ('/' == fname_in[0]) ? "" : "/", fname_in); + return fname; +} + const char kUFSCommands[] PROGMEM = "Ufs|" // Prefix "|Type|Size|Free|Delete|Rename|Run"; @@ -468,11 +476,13 @@ void UFSDelete(void) { // UfsDelete sdcard or flashfs file if only one of them available // UfsDelete2 flashfs file if available if (XdrvMailbox.data_len > 0) { + char fname[UFS_FILENAME_SIZE]; + UfsFilename(fname, XdrvMailbox.data); bool result = false; if (ffs_type && (ffs_type != ufs_type) && (2 == XdrvMailbox.index)) { - result = TfsDeleteFile(XdrvMailbox.data); + result = TfsDeleteFile(fname); } else { - result = (ufs_type && ufsp->remove(XdrvMailbox.data)); + result = (ufs_type && ufsp->remove(fname)); } if (!result) { ResponseCmndFailed(); @@ -487,13 +497,17 @@ void UFSRename(void) { // UfsRename2 flashfs file if available if (XdrvMailbox.data_len > 0) { bool result = false; - const char *fname1 = strtok(XdrvMailbox.data, ","); - const char *fname2 = strtok(nullptr, ","); + char *fname1 = strtok(XdrvMailbox.data, ","); + char *fname2 = strtok(nullptr, ","); if (fname1 && fname2) { + char fname_old[UFS_FILENAME_SIZE]; + UfsFilename(fname_old, fname1); + char fname_new[UFS_FILENAME_SIZE]; + UfsFilename(fname_new, fname2); if (ffs_type && (ffs_type != ufs_type) && (2 == XdrvMailbox.index)) { - result = TfsRenameFile(fname1, fname2); + result = TfsRenameFile(fname_old, fname_new); } else { - result = (ufs_type && ufsp->rename(fname1, fname2)); + result = (ufs_type && ufsp->rename(fname_old, fname_new)); } } if (!result) { @@ -506,7 +520,8 @@ void UFSRename(void) { void UFSRun(void) { if (XdrvMailbox.data_len > 0) { - if (UfsExecuteCommandFile(XdrvMailbox.data)) { + char fname[UFS_FILENAME_SIZE]; + if (UfsExecuteCommandFile(UfsFilename(fname, XdrvMailbox.data))) { ResponseClear(); } else { ResponseCmndFailed(); From 8a969eeca575913dfedb462ce7eedf0ab3bf79bb Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Sat, 20 Feb 2021 10:25:51 +0100 Subject: [PATCH 08/15] fix ili9342 rotation --- lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp | 8 +++++--- tasmota/xdsp_04_ili9341.ino | 9 ++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp b/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp index ebf828790..4af1ddc7f 100644 --- a/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp +++ b/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp @@ -411,17 +411,17 @@ void ILI9341_2::setRotation(uint8_t m) { _height = iheight; break; case 1: - m = (MADCTL_MV | MADCTL_BGR); + m = (MADCTL_MY | MADCTL_MV | MADCTL_BGR); _width = iheight; _height = iwidth; break; case 2: - m = (MADCTL_MY | MADCTL_BGR); + m = (MADCTL_MY | MADCTL_MX | MADCTL_BGR); _width = iwidth; _height = iheight; break; case 3: - m = (MADCTL_MX | MADCTL_MY | MADCTL_MV | MADCTL_BGR); + m = (MADCTL_MX | MADCTL_MV | MADCTL_BGR); _width = iheight; _height = iwidth; break; @@ -561,9 +561,11 @@ void ILI9341_2::DisplayOnff(int8_t on) { } void ILI9341_2::invertDisplay(boolean i) { + SPI_BEGIN_TRANSACTION(); ILI9341_2_CS_LOW writecmd(i ? ILI9341_2_INVON : ILI9341_2_INVOFF); ILI9341_2_CS_HIGH + SPI_END_TRANSACTION(); } void ili9342_dimm(uint8_t dim); diff --git a/tasmota/xdsp_04_ili9341.ino b/tasmota/xdsp_04_ili9341.ino index 2b1a31a73..57c00c225 100644 --- a/tasmota/xdsp_04_ili9341.ino +++ b/tasmota/xdsp_04_ili9341.ino @@ -42,7 +42,7 @@ bool tft_init_done = false; void ILI9341_InitDriver() { -#ifdef USE_M5STACK_CORE2 +#if (defined(USE_M5STACK_CORE2) || defined(USE_M5STACK_CORE_BASIC)) if (TasmotaGlobal.spi_enabled) { #else // There are displays without CS @@ -72,9 +72,14 @@ void ILI9341_InitDriver() fg_color = ILI9341_WHITE; bg_color = ILI9341_BLACK; + AddLog(LOG_LEVEL_INFO, PSTR("DSP: ILI934x 0")); + #ifdef USE_M5STACK_CORE2 // fixed pins on m5stack core2 ili9341_2 = new ILI9341_2(5, -2, 15, -2); +#elif defined(USE_M5STACK_CORE_BASIC) + // int8_t cs, int8_t res, int8_t dc, int8_t bp) + ili9341_2 = new ILI9341_2(14, 33, 27, 32); #else // check for special case with 2 SPI busses (ESP32 bitcoin) if (TasmotaGlobal.soft_spi_enabled) { @@ -94,6 +99,8 @@ void ILI9341_InitDriver() return; } + AddLog(LOG_LEVEL_INFO, PSTR("DSP: ILI934x 1")); + ili9341_2->init(Settings.display_width, Settings.display_height); renderer = ili9341_2; renderer->DisplayInit(DISPLAY_INIT_MODE, Settings.display_size, Settings.display_rotate, Settings.display_font); From 6edd24bbc66e1d95c83941c7abf9b37bafb51de6 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Sat, 20 Feb 2021 10:51:12 +0100 Subject: [PATCH 09/15] remove debug logs --- tasmota/xdsp_04_ili9341.ino | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tasmota/xdsp_04_ili9341.ino b/tasmota/xdsp_04_ili9341.ino index 57c00c225..133cf4366 100644 --- a/tasmota/xdsp_04_ili9341.ino +++ b/tasmota/xdsp_04_ili9341.ino @@ -72,8 +72,6 @@ void ILI9341_InitDriver() fg_color = ILI9341_WHITE; bg_color = ILI9341_BLACK; - AddLog(LOG_LEVEL_INFO, PSTR("DSP: ILI934x 0")); - #ifdef USE_M5STACK_CORE2 // fixed pins on m5stack core2 ili9341_2 = new ILI9341_2(5, -2, 15, -2); @@ -99,8 +97,6 @@ void ILI9341_InitDriver() return; } - AddLog(LOG_LEVEL_INFO, PSTR("DSP: ILI934x 1")); - ili9341_2->init(Settings.display_width, Settings.display_height); renderer = ili9341_2; renderer->DisplayInit(DISPLAY_INIT_MODE, Settings.display_size, Settings.display_rotate, Settings.display_font); From 53ac4d825246c0cd3d236801beaf71f8994e5e2c Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Sat, 20 Feb 2021 11:38:20 +0100 Subject: [PATCH 10/15] fix ili9342 backlight --- lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp b/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp index 4af1ddc7f..eb6e3a277 100644 --- a/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp +++ b/lib/lib_display/ILI9341-gemu-1.0/ILI9341_2.cpp @@ -527,7 +527,7 @@ void ili9342_bpwr(uint8_t on); void ILI9341_2::DisplayOnff(int8_t on) { - if (_hwspi>=2) { + if ((_hwspi >= 2) && (_bp < 0)) { ili9342_bpwr(on); } @@ -537,11 +537,11 @@ void ILI9341_2::DisplayOnff(int8_t on) { writecmd(ILI9341_2_DISPON); ILI9341_2_CS_HIGH SPI_END_TRANSACTION(); - if (_bp>=0) { + if (_bp >= 0) { #ifdef ILI9341_2_DIMMER - ledcWrite(ESP32_PWM_CHANNEL,dimmer); + ledcWrite(ESP32_PWM_CHANNEL, dimmer); #else - digitalWrite(_bp,HIGH); + digitalWrite(_bp, HIGH); #endif } } else { @@ -550,11 +550,11 @@ void ILI9341_2::DisplayOnff(int8_t on) { writecmd(ILI9341_2_DISPOFF); ILI9341_2_CS_HIGH SPI_END_TRANSACTION(); - if (_bp>=0) { + if (_bp >= 0) { #ifdef ILI9341_2_DIMMER - ledcWrite(ESP32_PWM_CHANNEL,0); + ledcWrite(ESP32_PWM_CHANNEL, 0); #else - digitalWrite(_bp,LOW); + digitalWrite(_bp, LOW); #endif } } From 82abbae3e6d2f48c1385e59e4b685219aff55900 Mon Sep 17 00:00:00 2001 From: stefanbode Date: Sat, 20 Feb 2021 15:06:36 +0100 Subject: [PATCH 11/15] Update xdrv_27_shutter.ino --- tasmota/xdrv_27_shutter.ino | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tasmota/xdrv_27_shutter.ino b/tasmota/xdrv_27_shutter.ino index 62b32797b..c5666b0de 100644 --- a/tasmota/xdrv_27_shutter.ino +++ b/tasmota/xdrv_27_shutter.ino @@ -416,11 +416,7 @@ void ShutterDecellerateForStop(uint8_t i) if (ShutterGlobal.position_mode == SHT_COUNTER){ missing_steps = ((Shutter[i].target_position-Shutter[i].start_position)*Shutter[i].direction*ShutterGlobal.open_velocity_max/RESOLUTION/STEPS_PER_SECOND) - RtcSettings.pulse_counter[i]; //prepare for stop PWM - AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Remain steps %d, Counter %d, Freq %d"), missing_steps, RtcSettings.pulse_counter[i] ,Shutter[i].pwm_velocity); Shutter[i].accelerator = 0; - Shutter[i].pwm_velocity = Shutter[i].pwm_velocity > 250 ? 250 : Shutter[i].pwm_velocity; - analogWriteFreq(Shutter[i].pwm_velocity); - analogWrite(Pin(GPIO_PWM1, i), 50); Shutter[i].pwm_velocity = 0; while (RtcSettings.pulse_counter[i] < (uint32_t)(Shutter[i].target_position-Shutter[i].start_position)*Shutter[i].direction*ShutterGlobal.open_velocity_max/RESOLUTION/STEPS_PER_SECOND) { } @@ -496,7 +492,7 @@ void ShutterUpdatePosition(void) Shutter[i].time, toBeAcc, current_stop_way, Shutter[i].pwm_velocity, velocity_max, Shutter[i].accelerator, min_runtime_ms, Shutter[i].real_position, next_possible_stop_position, Shutter[i].target_position, velocity_change_per_step_max, Shutter[i].direction); - if ( Shutter[i].real_position * Shutter[i].direction + 2*Shutter[i].pwm_velocity >= Shutter[i].target_position * Shutter[i].direction ) { + if ( Shutter[i].real_position * Shutter[i].direction >= Shutter[i].target_position * Shutter[i].direction || (ShutterGlobal.position_mode == SHT_COUNTER && Shutter[i].accelerator <0 && Shutter[i].pwm_velocity+Shutter[i].accelerator<=100)) { if (Shutter[i].direction != 0) { Shutter[i].lastdirection = Shutter[i].direction; } From 9a18ef38751e2eaf8004b374f2d54e43b5633cde Mon Sep 17 00:00:00 2001 From: stefanbode Date: Sat, 20 Feb 2021 15:11:52 +0100 Subject: [PATCH 12/15] Update xdrv_27_shutter.ino --- tasmota/xdrv_27_shutter.ino | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasmota/xdrv_27_shutter.ino b/tasmota/xdrv_27_shutter.ino index c5666b0de..171d7406c 100644 --- a/tasmota/xdrv_27_shutter.ino +++ b/tasmota/xdrv_27_shutter.ino @@ -406,10 +406,9 @@ void ShutterDecellerateForStop(uint8_t i) case SHT_COUNTER: int16_t missing_steps; Shutter[i].accelerator = -(ShutterGlobal.open_velocity_max / (Shutter[i].motordelay>4 ? (Shutter[i].motordelay*11)/10 : 4) ); - while (Shutter[i].pwm_velocity > -2*Shutter[i].accelerator && Shutter[i].pwm_velocity > 100) { + while (Shutter[i].pwm_velocity > -2*Shutter[i].accelerator || (ShutterGlobal.position_mode == SHT_COUNTER && Shutter[i].pwm_velocity > 100) ) { delay(50); AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Velocity %ld, Delta %d"), Shutter[i].pwm_velocity, Shutter[i].accelerator ); - //Shutter[i].pwm_velocity = tmax(Shutter[i].pwm_velocity-Shutter[i].accelerator , 0); // Control will be done in RTC Ticker. } From 0bba4dc7d695aef8fb24ccd73f2759c29abfeab9 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 20 Feb 2021 17:26:09 +0100 Subject: [PATCH 13/15] Fix compile error --- tasmota/xsns_37_rfsensor.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xsns_37_rfsensor.ino b/tasmota/xsns_37_rfsensor.ino index 424928a4a..3b469b2b5 100644 --- a/tasmota/xsns_37_rfsensor.ino +++ b/tasmota/xsns_37_rfsensor.ino @@ -272,7 +272,7 @@ void RfSnsTheoV2Show(bool json) sensor, GetDT(rfsns_theo_v2_t1[i].time).c_str(), voltage); } } else { - float temp = ConvertTemp((float)rfsns_theo_v2_t1[i].temp / 100) + float temp = ConvertTemp((float)rfsns_theo_v2_t1[i].temp / 100); if (json) { ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_TEMPERATURE "\":%*_f,\"" D_JSON_ILLUMINANCE "\":%d,\"" D_JSON_VOLTAGE "\":%s}"), From ca5ab2d09449a1c4797bd6e2f8ef5875d5888750 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Sat, 20 Feb 2021 17:32:01 +0100 Subject: [PATCH 14/15] send mqtt only on valid data --- tasmota/xsns_53_sml.ino | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tasmota/xsns_53_sml.ino b/tasmota/xsns_53_sml.ino index 878001ed4..e7d291a98 100755 --- a/tasmota/xsns_53_sml.ino +++ b/tasmota/xsns_53_sml.ino @@ -465,6 +465,7 @@ double meter_vars[SML_MAX_VARS]; double dvalues[MAX_DVARS]; uint32_t dtimes[MAX_DVARS]; uint8_t meters_used; +uint8_t dvalid[SML_MAX_VARS]; struct METER_DESC const *meter_desc_p; const uint8_t *meter_p; @@ -494,6 +495,7 @@ char meter_id[MAX_METERS][METER_ID_SIZE]; uint8_t sml_send_blocks; uint8_t sml_100ms_cnt; uint8_t sml_desc_cnt; +uint8_t sml_json_enable = 1; #ifdef USE_SML_MEDIAN_FILTER // median filter, should be odd size @@ -1621,6 +1623,7 @@ void SML_Decode(uint8_t index) { #else meter_vars[vindex]=dval; #endif + dvalid[vindex] = 1; //AddLog_P(LOG_LEVEL_INFO, PSTR(">> %s"),mp); // get scaling factor double fac=CharToDouble((char*)mp); @@ -1779,6 +1782,8 @@ void SML_Show(boolean json) { dtostrfd(meter_vars[index],dp,tpowstr); } + if (!dvalid[index]) nojson = 1; + if (json) { // json export if (index==0) { @@ -1953,6 +1958,7 @@ void SML_Init(void) { for (uint32_t cnt=0;cnt Date: Sun, 21 Feb 2021 12:17:39 +0100 Subject: [PATCH 15/15] Fix TM1637 driver Fix TM1637 driver now needs ``TM1637 CLK`` and ``TM1637 DIO`` to enable (#11057) --- CHANGELOG.md | 2 + RELEASENOTES.md | 2 + tasmota/language/af_AF.h | 8 +- tasmota/language/bg_BG.h | 8 +- tasmota/language/cs_CZ.h | 8 +- tasmota/language/de_DE.h | 8 +- tasmota/language/el_GR.h | 8 +- tasmota/language/en_GB.h | 8 +- tasmota/language/es_ES.h | 8 +- tasmota/language/fr_FR.h | 8 +- tasmota/language/fy_NL.h | 8 +- tasmota/language/he_HE.h | 8 +- tasmota/language/hu_HU.h | 8 +- tasmota/language/it_IT.h | 8 +- tasmota/language/ko_KO.h | 8 +- tasmota/language/nl_NL.h | 8 +- tasmota/language/pl_PL.h | 8 +- tasmota/language/pt_BR.h | 8 +- tasmota/language/pt_PT.h | 8 +- tasmota/language/ro_RO.h | 8 +- tasmota/language/ru_RU.h | 8 +- tasmota/language/sk_SK.h | 8 +- tasmota/language/sv_SE.h | 8 +- tasmota/language/tr_TR.h | 8 +- tasmota/language/uk_UA.h | 8 +- tasmota/language/vi_VN.h | 8 +- tasmota/language/zh_CN.h | 8 +- tasmota/language/zh_TW.h | 8 +- tasmota/tasmota_template.h | 9 +- tasmota/xdsp_15_tm1637.ino | 311 +++++++++++++++++-------------------- tasmota/xsns_28_tm1638.ino | 2 +- 31 files changed, 289 insertions(+), 245 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48cd42700..f565c2f0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,9 @@ All notable changes to this project will be documented in this file. ### Fixed - Ili1942 driver (#11046) +- Shutter driver (#11055) - ESP32 Mi32 driver (#11048) +- TM1637 driver now needs ``TM1637 CLK`` and ``TM1637 DIO`` to enable (#11057) ## [Released] diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 8df5b85cc..97b9f1316 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -85,4 +85,6 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota ### Fixed - Ili1942 driver [#11046](https://github.com/arendst/Tasmota/issues/11046) +- Shutter driver [#11055](https://github.com/arendst/Tasmota/issues/11055) - ESP32 Mi32 driver [#11048](https://github.com/arendst/Tasmota/issues/11048) +- TM1637 driver now needs ``TM1637 CLK`` and ``TM1637 DIO`` to enable [#11057](https://github.com/arendst/Tasmota/issues/11057) diff --git a/tasmota/language/af_AF.h b/tasmota/language/af_AF.h index 05f4c7154..90d12bfa9 100644 --- a/tasmota/language/af_AF.h +++ b/tasmota/language/af_AF.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/bg_BG.h b/tasmota/language/bg_BG.h index 1e6a0d5ef..078298d27 100644 --- a/tasmota/language/bg_BG.h +++ b/tasmota/language/bg_BG.h @@ -637,9 +637,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/cs_CZ.h b/tasmota/language/cs_CZ.h index 1f1e4f156..b252002bb 100644 --- a/tasmota/language/cs_CZ.h +++ b/tasmota/language/cs_CZ.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h index 7817531a5..8c3dac821 100644 --- a/tasmota/language/de_DE.h +++ b/tasmota/language/de_DE.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/el_GR.h b/tasmota/language/el_GR.h index 4fbf89dd9..0b324b607 100644 --- a/tasmota/language/el_GR.h +++ b/tasmota/language/el_GR.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index af7cef8d6..0d0f0b3c9 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/es_ES.h b/tasmota/language/es_ES.h index 8f99d5fb1..5fc31926d 100644 --- a/tasmota/language/es_ES.h +++ b/tasmota/language/es_ES.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/fr_FR.h b/tasmota/language/fr_FR.h index 958dca519..a07e6dde3 100644 --- a/tasmota/language/fr_FR.h +++ b/tasmota/language/fr_FR.h @@ -634,9 +634,11 @@ #define D_SENSOR_SDM630_RX "SDM630 RX" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/fy_NL.h b/tasmota/language/fy_NL.h index d2511ba47..3ac159c0b 100644 --- a/tasmota/language/fy_NL.h +++ b/tasmota/language/fy_NL.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/he_HE.h b/tasmota/language/he_HE.h index b90029ede..eb68c4ba5 100644 --- a/tasmota/language/he_HE.h +++ b/tasmota/language/he_HE.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/hu_HU.h b/tasmota/language/hu_HU.h index 2c74d5134..f24a894c5 100644 --- a/tasmota/language/hu_HU.h +++ b/tasmota/language/hu_HU.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h index d15849bad..c3d516d57 100644 --- a/tasmota/language/it_IT.h +++ b/tasmota/language/it_IT.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 - RX" #define D_SENSOR_WE517_TX "WE517 - TX" #define D_SENSOR_WE517_RX "WE517 - RX" -#define D_SENSOR_TM1638_CLK "TM16 - CLK" -#define D_SENSOR_TM1638_DIO "TM16 - DIO" -#define D_SENSOR_TM1638_STB "TM16 - STB" +#define D_SENSOR_TM1637_CLK "TM1637 - CLK" +#define D_SENSOR_TM1637_DIO "TM1637 - DIO" +#define D_SENSOR_TM1638_CLK "TM1638 - CLK" +#define D_SENSOR_TM1638_DIO "TM1638 - DIO" +#define D_SENSOR_TM1638_STB "TM1638 - STB" #define D_SENSOR_HX711_SCK "HX711 - SCK" #define D_SENSOR_HX711_DAT "HX711 - DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/ko_KO.h b/tasmota/language/ko_KO.h index d96b76f76..1463febd9 100644 --- a/tasmota/language/ko_KO.h +++ b/tasmota/language/ko_KO.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/nl_NL.h b/tasmota/language/nl_NL.h index 3c9a0773c..2b8730d9e 100644 --- a/tasmota/language/nl_NL.h +++ b/tasmota/language/nl_NL.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/pl_PL.h b/tasmota/language/pl_PL.h index d477cccd3..e356bb627 100644 --- a/tasmota/language/pl_PL.h +++ b/tasmota/language/pl_PL.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h index 3660bdaa1..968c04065 100644 --- a/tasmota/language/pt_BR.h +++ b/tasmota/language/pt_BR.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/pt_PT.h b/tasmota/language/pt_PT.h index 3b4ea2614..9baa0c300 100644 --- a/tasmota/language/pt_PT.h +++ b/tasmota/language/pt_PT.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/ro_RO.h b/tasmota/language/ro_RO.h index c6810406d..155bf020f 100644 --- a/tasmota/language/ro_RO.h +++ b/tasmota/language/ro_RO.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/ru_RU.h b/tasmota/language/ru_RU.h index 8941a770d..2390db6c8 100644 --- a/tasmota/language/ru_RU.h +++ b/tasmota/language/ru_RU.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/sk_SK.h b/tasmota/language/sk_SK.h index e30692e58..cc803e84f 100644 --- a/tasmota/language/sk_SK.h +++ b/tasmota/language/sk_SK.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/sv_SE.h b/tasmota/language/sv_SE.h index dad72de28..9fa5c17ba 100644 --- a/tasmota/language/sv_SE.h +++ b/tasmota/language/sv_SE.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/tr_TR.h b/tasmota/language/tr_TR.h index ab7d00a31..a660dc797 100644 --- a/tasmota/language/tr_TR.h +++ b/tasmota/language/tr_TR.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/uk_UA.h b/tasmota/language/uk_UA.h index c2c1cbd72..0b9346ceb 100644 --- a/tasmota/language/uk_UA.h +++ b/tasmota/language/uk_UA.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/vi_VN.h b/tasmota/language/vi_VN.h index e71874381..2e0173289 100644 --- a/tasmota/language/vi_VN.h +++ b/tasmota/language/vi_VN.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/zh_CN.h b/tasmota/language/zh_CN.h index 186a013eb..9e5d6b0a7 100644 --- a/tasmota/language/zh_CN.h +++ b/tasmota/language/zh_CN.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/language/zh_TW.h b/tasmota/language/zh_TW.h index 5a8e3591f..7ea86dbc7 100644 --- a/tasmota/language/zh_TW.h +++ b/tasmota/language/zh_TW.h @@ -638,9 +638,11 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" -#define D_SENSOR_TM1638_CLK "TM16 CLK" -#define D_SENSOR_TM1638_DIO "TM16 DIO" -#define D_SENSOR_TM1638_STB "TM16 STB" +#define D_SENSOR_TM1637_CLK "TM1637 CLK" +#define D_SENSOR_TM1637_DIO "TM1637 DIO" +#define D_SENSOR_TM1638_CLK "TM1638 CLK" +#define D_SENSOR_TM1638_DIO "TM1638 DIO" +#define D_SENSOR_TM1638_STB "TM1638 STB" #define D_SENSOR_HX711_SCK "HX711 SCK" #define D_SENSOR_HX711_DAT "HX711 DAT" #define D_SENSOR_FTC532 "FTC532" diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 7b4fc3ae3..6221c833c 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -149,6 +149,7 @@ enum UserSelectablePins { GPIO_WIEGAND_D0, GPIO_WIEGAND_D1, // Wiegand Data lines GPIO_NEOPOOL_TX, GPIO_NEOPOOL_RX, // Sugar Valley RS485 interface GPIO_SDM72_TX, GPIO_SDM72_RX, // SDM72 Serial interface + GPIO_TM1637CLK, GPIO_TM1637DIO, // TM1637 interface GPIO_SENSOR_END }; enum ProgramSelectablePins { @@ -318,6 +319,7 @@ const char kSensorNames[] PROGMEM = D_SENSOR_WIEGAND_D0 "|" D_SENSOR_WIEGAND_D1 "|" D_SENSOR_NEOPOOL_TX "|" D_SENSOR_NEOPOOL_RX "|" D_SENSOR_SDM72_TX "|" D_SENSOR_SDM72_RX "|" + D_SENSOR_TM1637_CLK "|" D_SENSOR_TM1637_DIO "|" ; const char kSensorNamesFixed[] PROGMEM = @@ -431,9 +433,14 @@ const uint16_t kGpioNiceList[] PROGMEM = { AGPIO(GPIO_SSD1331_CS), AGPIO(GPIO_SSD1331_DC), #endif // USE_DISPLAY_SSD1331 +#ifdef USE_DISPLAY_TM1637 + AGPIO(GPIO_TM1637CLK), + AGPIO(GPIO_TM1637DIO), +#endif // USE_DISPLAY_TM1637 AGPIO(GPIO_BACKLIGHT), // Display backlight control AGPIO(GPIO_OLED_RESET), // OLED Display Reset -#endif +#endif // USE_DISPLAY + #ifdef USE_MAX31865 AGPIO(GPIO_SSPI_MAX31865_CS1) + MAX_MAX31865S, #endif diff --git a/tasmota/xdsp_15_tm1637.ino b/tasmota/xdsp_15_tm1637.ino index 79bf3ab93..7ea7c0ea1 100644 --- a/tasmota/xdsp_15_tm1637.ino +++ b/tasmota/xdsp_15_tm1637.ino @@ -51,27 +51,27 @@ Clears the display, command: "DisplayClear" - DisplayNumber num [,position {0-(NUM_DIGITS-1))} [,leading_zeros {0|1} [,length {1 to NUM_DIGITS}]]] + DisplayNumber num [,position {0-(TM1637Data.num_digits-1))} [,leading_zeros {0|1} [,length {1 to TM1637Data.num_digits}]]] Clears and then displays number without decimal. command e.g., "DisplayNumber 1234" Control 'leading zeros', 'length' and 'position' with "DisplayNumber 1234, , , " - 'leading zeros' can be 1 or 0 (default), 'length' can be 1 to NUM_DIGITS, 'position' can be 0 (left-most) to NUM_DIGITS (right-most). + 'leading zeros' can be 1 or 0 (default), 'length' can be 1 to TM1637Data.num_digits, 'position' can be 0 (left-most) to TM1637Data.num_digits (right-most). See function description below for more details. - DisplayNumberNC num [,position {0-(NUM_DIGITS-1))} [,leading_zeros {0|1} [,length {1 to NUM_DIGITS}]]] + DisplayNumberNC num [,position {0-(TM1637Data.num_digits-1))} [,leading_zeros {0|1} [,length {1 to TM1637Data.num_digits}]]] Display integer number as above, but without clearing first. e.g., "DisplayNumberNC 1234". Usage is same as above. - DisplayFloat num [,position {0-(NUM_DIGITS-1)} [,precision {0-NUM_DIGITS} [,length {1 to NUM_DIGITS}]]] + DisplayFloat num [,position {0-(TM1637Data.num_digits-1)} [,precision {0-TM1637Data.num_digits} [,length {1 to TM1637Data.num_digits}]]] Clears and then displays float (with decimal point) command e.g., "DisplayFloat 12.34" See function description below for more details. - DisplayFloatNC num [,position {0-(NUM_DIGITS-1)} [,precision {0-NUM_DIGITS} [,length {1 to NUM_DIGITS}]]] + DisplayFloatNC num [,position {0-(TM1637Data.num_digits-1)} [,precision {0-TM1637Data.num_digits} [,length {1 to TM1637Data.num_digits}]]] Displays float (with decimal point) as above, but without clearing first. command e.g., "DisplayFloatNC 12.34" See function description below for more details. @@ -84,24 +84,24 @@ - DisplayRaw position {0-(NUM_DIGITS-1)},length {1 to NUM_DIGITS}, num1 [, num2[, num3[, num4[, ...upto NUM_DIGITS numbers]]]]] + DisplayRaw position {0-(TM1637Data.num_digits-1)},length {1 to TM1637Data.num_digits}, num1 [, num2[, num3[, num4[, ...upto TM1637Data.num_digits numbers]]]]] - Takes upto NUM_DIGITS comma-separated integers (0-255) and displays raw segments. Each number represents a + Takes upto TM1637Data.num_digits comma-separated integers (0-255) and displays raw segments. Each number represents a 7-segment digit. Each 8-bit number represents individual segments of a digit. For example, the command "DisplayRaw 0, 4, 255, 255, 255, 255" would display "[8.8.8.8.]" - DisplayText text [, position {0-(NUM_DIGITS-1)} [,length {1 to NUM_DIGITS}]] + DisplayText text [, position {0-(TM1637Data.num_digits-1)} [,length {1 to TM1637Data.num_digits}]] Clears and then displays basic text. command e.g., "DisplayText ajith vasudevan" Control 'length' and 'position' with "DisplayText , , " - 'length' can be 1 to NUM_DIGITS, 'position' can be 0 (left-most) to NUM_DIGITS-1 (right-most) + 'length' can be 1 to TM1637Data.num_digits, 'position' can be 0 (left-most) to TM1637Data.num_digits-1 (right-most) A caret(^) symbol in the text input is dispayed as the degrees(°) symbol. This is useful for displaying Temperature! For example, the command "DisplayText 22.5^" will display "22.5°". - DisplayTextNC text [, position {0-NUM_DIGITS-1} [,length {1 to NUM_DIGITS}]] + DisplayTextNC text [, position {0-TM1637Data.num_digits-1} [,length {1 to TM1637Data.num_digits}]] Clears first, then displays text. Usage is same as above. @@ -134,53 +134,58 @@ \*********************************************************************************************/ -#define XDSP_15 15 -#include "SevenSegmentTM1637.h" - -SevenSegmentTM1637 *display; -bool showClock = false; -bool clock24 = false; -char tm[5]; -char msg[60]; -uint32_t NUM_DIGITS = 4; -uint32_t prev_num_digits = 4; -bool scroll = false; -uint32_t scrolldelay = 4; -uint32_t scrollindex = 0; -uint32_t iteration = 0; -uint32_t brightness = 5; - +#define XDSP_15 15 #define BRIGHTNESS_MIN 0 // Display OFF #define BRIGHTNESS_MAX 8 -#define CMD_MAX_LEN 55 -#define LEVEL_MIN 0 -#define LEVEL_MAX 100 -#define SCROLL_MAX_LEN 50 +#define CMD_MAX_LEN 55 +#define LEVEL_MIN 0 +#define LEVEL_MAX 100 +#define SCROLL_MAX_LEN 50 -char scrolltext[CMD_MAX_LEN]; +#include "SevenSegmentTM1637.h" +SevenSegmentTM1637 *display; + +struct { + char scroll_text[CMD_MAX_LEN]; + char msg[60]; + uint8_t num_digits = 4; + uint8_t prev_num_digits = 4; + uint8_t scroll_delay = 4; + uint8_t scroll_index = 0; + uint8_t iteration = 0; + uint8_t brightness = 5; + + bool scroll = false; + bool show_clock = false; + bool clock_24 = false; +} TM1637Data; /*********************************************************************************************\ * Init function \*********************************************************************************************/ -bool TM1637Init(void) { - display = new SevenSegmentTM1637(Pin(GPIO_SSPI_SCLK), Pin(GPIO_SSPI_MOSI) ); - NUM_DIGITS = Settings.display_size > 3 ? Settings.display_size : 4; - Settings.display_size = NUM_DIGITS; - display->begin(NUM_DIGITS, 1); - display->setBacklight(brightness * 10); - clearDisplay(); - Settings.display_model = XDSP_15; - AddLog(LOG_LEVEL_INFO, PSTR("DSP: TM1637 display driver initialized")); - return true; +void TM1637Init(void) { + if (PinUsed(GPIO_TM1637CLK) && PinUsed(GPIO_TM1637DIO)) { + display = new SevenSegmentTM1637(Pin(GPIO_TM1637CLK), Pin(GPIO_TM1637DIO) ); + if (display) { + Settings.display_model = XDSP_15; + + TM1637Data.num_digits = Settings.display_size > 3 ? Settings.display_size : 4; + Settings.display_size = TM1637Data.num_digits; + display->begin(TM1637Data.num_digits, 1); + display->setBacklight(TM1637Data.brightness * 10); + TM1637ClearDisplay(); + AddLog(LOG_LEVEL_INFO, PSTR("DSP: TM1637")); + } + } } /*********************************************************************************************\ * Displays number without decimal, with/without leading zeros, specifying start-position * and length, optionally skipping clearing display before displaying the number. -* commands: DisplayNumber num [,position {0-(NUM_DIGITS-1)} [,leading_zeros {0|1} [,length {1 to NUM_DIGITS}]]] -* DisplayNumberNC num [,position {0-(NUM_DIGITS-1)} [,leading_zeros {0|1} [,length {1 to NUM_DIGITS}]]] // "NC" --> "No Clear" +* commands: DisplayNumber num [,position {0-(TM1637Data.num_digits-1)} [,leading_zeros {0|1} [,length {1 to TM1637Data.num_digits}]]] +* DisplayNumberNC num [,position {0-(TM1637Data.num_digits-1)} [,leading_zeros {0|1} [,length {1 to TM1637Data.num_digits}]]] // "NC" --> "No Clear" \*********************************************************************************************/ bool CmndTM1637Number(bool clear) { char sNum[CMD_MAX_LEN]; @@ -210,46 +215,41 @@ bool CmndTM1637Number(bool clear) { } - if((position < 0) || (position > (NUM_DIGITS-1))) position = 0; + if((position < 0) || (position > (TM1637Data.num_digits-1))) position = 0; - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: num=%d"), num); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: position=%d"), position); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: leadingzeros=%d"), leadingzeros); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: length=%d"), length); + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: num %d, pos %d, lead %d, len %d"), num, position, leadingzeros, length); - if(clear) clearDisplay(); + if(clear) TM1637ClearDisplay(); char txt[30]; snprintf_P(txt, sizeof(txt), PSTR("%d"), num); if(!length) length = strlen(txt); - if((length < 0) || (length > NUM_DIGITS)) length = NUM_DIGITS; + if((length < 0) || (length > TM1637Data.num_digits)) length = TM1637Data.num_digits; char pad = (leadingzeros ? '0': ' '); uint32_t i = position; uint8_t rawBytes[1]; rawBytes[0] = display->encode(pad); for(; iNUM_DIGITS) break; + if(i>TM1637Data.num_digits) break; display->printRaw(rawBytes, 1, i); } for(uint32_t j = 0; i< position + length; i++, j++) { if(txt[j] == 0) break; rawBytes[0] = display->encode(txt[j]); - if(i>NUM_DIGITS) break; + if(i>TM1637Data.num_digits) break; display->printRaw(rawBytes, 1, i); } return true; } - - /*********************************************************************************************\ * Displays number with decimal, specifying position, precision and length, * optionally skipping clearing display before displaying the number. -* commands: DisplayFloat num [,position {0-(NUM_DIGITS-1)} [,precision {0-NUM_DIGITS} [,length {1 to NUM_DIGITS}]]] -* DisplayFloatNC num [,position {0-(NUM_DIGITS-1)} [,precision {0-NUM_DIGITS} [,length {1 to NUM_DIGITS}]]] // "NC" --> "No Clear" +* commands: DisplayFloat num [,position {0-(TM1637Data.num_digits-1)} [,precision {0-TM1637Data.num_digits} [,length {1 to TM1637Data.num_digits}]]] +* DisplayFloatNC num [,position {0-(TM1637Data.num_digits-1)} [,precision {0-TM1637Data.num_digits} [,length {1 to TM1637Data.num_digits}]]] // "NC" --> "No Clear" \*********************************************************************************************/ bool CmndTM1637Float(bool clear) { @@ -258,7 +258,7 @@ bool CmndTM1637Float(bool clear) { char sPosition[CMD_MAX_LEN]; char sLength[CMD_MAX_LEN]; uint8_t length = 0; - uint8_t precision = NUM_DIGITS; + uint8_t precision = TM1637Data.num_digits; uint8_t position = 0; float fnum = 0.0f; @@ -280,22 +280,19 @@ bool CmndTM1637Float(bool clear) { } - if((position < 0) || (position > (NUM_DIGITS-1))) position = 0; - if((precision < 0) || (precision > NUM_DIGITS)) precision = NUM_DIGITS; + if((position < 0) || (position > (TM1637Data.num_digits-1))) position = 0; + if((precision < 0) || (precision > TM1637Data.num_digits)) precision = TM1637Data.num_digits; - if(clear) clearDisplay(); + if(clear) TM1637ClearDisplay(); char txt[30]; ext_snprintf_P(txt, sizeof(txt), PSTR("%*_f"), precision, &fnum); if(!length) length = strlen(txt); - if((length <= 0) || (length > NUM_DIGITS)) length = NUM_DIGITS; + if((length <= 0) || (length > TM1637Data.num_digits)) length = TM1637Data.num_digits; + + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: num %4_f, prec %d, len %d"), &fnum, precision, length); - char s[30]; - ext_snprintf_P(s, sizeof(s), PSTR("LOG: TM1637: num=%*_f"), 4, &fnum); - AddLog(LOG_LEVEL_DEBUG, PSTR("%s"), s); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: precision=%d"), precision); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: length=%d"), length); uint8_t rawBytes[1]; for(uint32_t i=0, j=0; i NUM_DIGITS) break; + if((j+position) > TM1637Data.num_digits) break; display->printRaw(rawBytes, 1, j+position); } @@ -318,17 +315,17 @@ bool CmndTM1637Float(bool clear) { // * Command: DisplayClear // \*********************************************************************************************/ bool CmndTM1637Clear(void) { - clearDisplay(); - sprintf(msg, PSTR("Cleared")); - XdrvMailbox.data = msg; + TM1637ClearDisplay(); + sprintf(TM1637Data.msg, PSTR("Cleared")); + XdrvMailbox.data = TM1637Data.msg; return true; } -void clearDisplay (void) { +void TM1637ClearDisplay (void) { unsigned char arr[] = {0}; - AddLog(LOG_LEVEL_DEBUG, PSTR("Clearing digit %d"), NUM_DIGITS); - for(int i=0; iprintRaw(arr, 1, i); + AddLog(LOG_LEVEL_DEBUG, PSTR("Clearing digit %d"), TM1637Data.num_digits); + for(int i=0; iprintRaw(arr, 1, i); } @@ -338,17 +335,17 @@ void clearDisplay (void) { \*********************************************************************************************/ bool CmndTM1637ScrollText(void) { - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: text=%s"), XdrvMailbox.data); + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: Text %s"), XdrvMailbox.data); if(XdrvMailbox.data_len > SCROLL_MAX_LEN) { - snprintf(msg, sizeof(msg), PSTR("Text too long. Length should be less than %d"), SCROLL_MAX_LEN); - XdrvMailbox.data = msg; + snprintf(TM1637Data.msg, sizeof(TM1637Data.msg), PSTR("Text too long. Length should be less than %d"), SCROLL_MAX_LEN); + XdrvMailbox.data = TM1637Data.msg; return false; } else { - snprintf(scrolltext, sizeof(scrolltext), PSTR("%s"), XdrvMailbox.data); - scrolltext[XdrvMailbox.data_len] = 0; - scrollindex = 0; - scroll = true; + snprintf(TM1637Data.scroll_text, sizeof(TM1637Data.scroll_text), PSTR("%s"), XdrvMailbox.data); + TM1637Data.scroll_text[XdrvMailbox.data_len] = 0; + TM1637Data.scroll_index = 0; + TM1637Data.scroll = true; return true; } @@ -361,8 +358,8 @@ bool CmndTM1637ScrollText(void) { * Command: DisplayScrollDelay delay {0-15} // default = 4 \*********************************************************************************************/ bool CmndTM1637ScrollDelay(void) { - if(scrolldelay<0) scrolldelay=0; - scrolldelay = XdrvMailbox.payload; + if(TM1637Data.scroll_delay<0) TM1637Data.scroll_delay=0; + TM1637Data.scroll_delay = XdrvMailbox.payload; return true; } @@ -371,36 +368,31 @@ bool CmndTM1637ScrollDelay(void) { /*********************************************************************************************\ * Scrolls a given string. Called every 50ms \*********************************************************************************************/ -void scrollText(void) { - if(scroll) { - iteration++; - if(scrolldelay) iteration = iteration % scrolldelay; - else iteration = 0; - if(iteration) return; +void TM1637ScrollText(void) { + if(TM1637Data.scroll) { + TM1637Data.iteration++; + if(TM1637Data.scroll_delay) TM1637Data.iteration = TM1637Data.iteration % TM1637Data.scroll_delay; + else TM1637Data.iteration = 0; + if(TM1637Data.iteration) return; - if(scrollindex > strlen(scrolltext)) { - scroll = false; - scrollindex = 0; + if(TM1637Data.scroll_index > strlen(TM1637Data.scroll_text)) { + TM1637Data.scroll = false; + TM1637Data.scroll_index = 0; return; } bool clr = false; uint8_t rawBytes[1]; - for(uint32_t i=0, j=scrollindex; i< strlen(scrolltext); i++, j++) { - if(i > (NUM_DIGITS-1)) break; - if(scrolltext[j] == 0) {clr = true;}; - char charToDisp = (clr ? ' ' : scrolltext[j]); + for(uint32_t i=0, j=TM1637Data.scroll_index; i< strlen(TM1637Data.scroll_text); i++, j++) { + if(i > (TM1637Data.num_digits-1)) break; + if(TM1637Data.scroll_text[j] == 0) {clr = true;}; + char charToDisp = (clr ? ' ' : TM1637Data.scroll_text[j]); rawBytes[0] = display->encode(charToDisp); display->printRaw(rawBytes, 1, i); } - scrollindex++; + TM1637Data.scroll_index++; } } - - - - - /*********************************************************************************************\ * Displays a horizontal bar graph. Takes a percentage number (0-100) as input * Command: DisplayLevel level {0-100} @@ -408,40 +400,39 @@ void scrollText(void) { bool CmndTM1637Level(void) { uint16_t val = XdrvMailbox.payload; if((val < LEVEL_MIN) || (val > LEVEL_MAX)) { - sprintf(msg, PSTR("Level should be a number in the range [%d, %d]"), LEVEL_MIN, LEVEL_MAX); - XdrvMailbox.data = msg; + sprintf(TM1637Data.msg, PSTR("Level should be a number in the range [%d, %d]"), LEVEL_MIN, LEVEL_MAX); + XdrvMailbox.data = TM1637Data.msg; return false; } - uint8_t totalBars = 2*NUM_DIGITS; - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: CmndTM1637Level totalBars=%d"), totalBars); + uint8_t totalBars = 2*TM1637Data.num_digits; + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: CmndTM1637Level totalBars %d"), totalBars); float barsToDisplay = totalBars * val / 100.0f; char txt[5]; ext_snprintf_P(txt, sizeof(txt), PSTR("%*_f"), 1, &barsToDisplay); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: CmndTM1637Level barsToDisplay=%s"), txt); + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: CmndTM1637Level barsToDisplay %s"), txt); char s[4]; - ext_snprintf_P(s, sizeof(s), PSTR("%*_f"), 0, &barsToDisplay); + ext_snprintf_P(s, sizeof(s), PSTR("%0_f"), &barsToDisplay); uint8_t numBars = atoi(s); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: CmndTM1637Level numBars=%d"), numBars); + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: CmndTM1637Level numBars %d"), numBars); - clearDisplay(); + TM1637ClearDisplay(); uint8_t rawBytes[1]; for(int i=1; i<=numBars; i++) { uint8_t digit = (i-1) / 2; - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: CmndTM1637Level digit=%d"), digit); + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: CmndTM1637Level digit %d"), digit); uint8_t value = (((i%2) == 0) ? 54 : 48); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: CmndTM1637Level value=%d"), value); + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: CmndTM1637Level value %d"), value); rawBytes[0] = value; display->printRaw(rawBytes, 1, digit); } return true; } - /*********************************************************************************************\ * Display arbitrary data on the display module -* Command: DisplayRaw position {0-(NUM_DIGITS-1)},length {1 to NUM_DIGITS}, a [, b[, c[, d[...upto NUM_DIGITS]]]] -* where a,b,c,d... are upto NUM_DIGITS numbers in the range 0-255, each number (byte) +* Command: DisplayRaw position {0-(TM1637Data.num_digits-1)},length {1 to TM1637Data.num_digits}, a [, b[, c[, d[...upto TM1637Data.num_digits]]]] +* where a,b,c,d... are upto TM1637Data.num_digits numbers in the range 0-255, each number (byte) * corresponding to a single 7-segment digit. Within each byte, bit 0 is segment A, * bit 1 is segment B etc. The function may either set the entire display * or any desired part using the length and position parameters. @@ -492,23 +483,16 @@ bool CmndTM1637Raw(void) { } if(!length) length = ArgC() - 2; - if(length < 0 || length > NUM_DIGITS) length = NUM_DIGITS; - if(position < 0 || position > (NUM_DIGITS-1)) position = 0; + if(length < 0 || length > TM1637Data.num_digits) length = TM1637Data.num_digits; + if(position < 0 || position > (TM1637Data.num_digits-1)) position = 0; - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: a=%d"), DATA[0]); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: b=%d"), DATA[1]); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: c=%d"), DATA[2]); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: d=%d"), DATA[3]); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: e=%d"), DATA[4]); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: f=%d"), DATA[5]); - - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: length=%d"), length); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: position=%d"), position); + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: a %d, b %d, c %d, d %d, e %d, f %d, len %d, pos %d"), + DATA[0], DATA[1], DATA[2], DATA[3], DATA[4], DATA[5], length, position); uint8_t rawBytes[1]; for(uint32_t i=position; i(NUM_DIGITS-1)) break; + if(i>(TM1637Data.num_digits-1)) break; rawBytes[0] = DATA[i-position]; display->printRaw(rawBytes, 1, i); } @@ -516,13 +500,11 @@ bool CmndTM1637Raw(void) { return true; } - - /*********************************************************************************************\ * Display a given string. * Text can be placed at arbitrary location on the display using the length and * position parameters without affecting the rest of the display. -* Command: DisplayText text [, position {0-(NUM_DIGITS-1)} [,length {1 to NUM_DIGITS}]] +* Command: DisplayText text [, position {0-(TM1637Data.num_digits-1)} [,length {1 to TM1637Data.num_digits}]] \*********************************************************************************************/ bool CmndTM1637Text(bool clear) { char sString[CMD_MAX_LEN + 1]; @@ -544,21 +526,19 @@ bool CmndTM1637Text(bool clear) { } - if((position < 0) || (position > (NUM_DIGITS-1))) position = 0; + if((position < 0) || (position > (TM1637Data.num_digits-1))) position = 0; - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: sString=%s"), sString); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: position=%d"), position); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: length=%d"), length); + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: sString %s, pos %d, len %d"), sString, position, length); - if(clear) clearDisplay(); + if(clear) TM1637ClearDisplay(); if(!length) length = strlen(sString); - if((length < 0) || (length > NUM_DIGITS)) length = NUM_DIGITS; + if((length < 0) || (length > TM1637Data.num_digits)) length = TM1637Data.num_digits; uint32_t i = position; uint8_t rawBytes[1]; for(uint32_t j = 0; i< position + length; i++, j++) { - if(i > (NUM_DIGITS-1)) break; + if(i > (TM1637Data.num_digits-1)) break; if(sString[j] == 0) break; rawBytes[0] = display->encode(sString[j]); if(sString[j+1] == '.') { @@ -582,18 +562,18 @@ bool CmndTM1637Brightness(void) { uint16_t val = XdrvMailbox.payload; if(ArgC() == 0) { - XdrvMailbox.payload = brightness; + XdrvMailbox.payload = TM1637Data.brightness; return true; } if((val < BRIGHTNESS_MIN) || (val > BRIGHTNESS_MAX)) { - sprintf(msg, PSTR("Brightness should be a number in the range [%d, %d]"), BRIGHTNESS_MIN, BRIGHTNESS_MAX); - XdrvMailbox.data = msg; + sprintf(TM1637Data.msg, PSTR("Brightness should be a number in the range [%d, %d]"), BRIGHTNESS_MIN, BRIGHTNESS_MAX); + XdrvMailbox.data = TM1637Data.msg; return false; } - brightness = val; + TM1637Data.brightness = val; - display->setBacklight(brightness*10); + display->setBacklight(TM1637Data.brightness*10); return true; } @@ -607,17 +587,17 @@ bool CmndTM1637Brightness(void) { \*********************************************************************************************/ bool CmndTM1637Clock(void) { - showClock = XdrvMailbox.payload; + TM1637Data.show_clock = XdrvMailbox.payload; if(ArgC() == 0) XdrvMailbox.payload = 1; - if(XdrvMailbox.payload > 1) clock24 = true; - else if(XdrvMailbox.payload == 1) clock24 = false; + if(XdrvMailbox.payload > 1) TM1637Data.clock_24 = true; + else if(XdrvMailbox.payload == 1) TM1637Data.clock_24 = false; - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: showClock=%d"), showClock); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: clock24=%d"), clock24); + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: TM1637Data.show_clock %d, TM1637Data.clock_24 %d"), + TM1637Data.show_clock, TM1637Data.clock_24); - if(!showClock) { - clearDisplay(); + if(!TM1637Data.show_clock) { + TM1637ClearDisplay(); } return true; } @@ -626,19 +606,20 @@ bool CmndTM1637Clock(void) { /*********************************************************************************************\ * refreshes the time if clock is displayed \*********************************************************************************************/ -void showTime() { +void TM1637ShowTime() { uint8_t hr = RtcTime.hour; uint8_t mn = RtcTime.minute; // uint8_t hr = 1; // uint8_t mn = 0; char z = ' '; - if(clock24) { + if(TM1637Data.clock_24) { z = '0'; } else { if(hr > 12) hr -= 12; if(hr == 0) hr = 12; } + char tm[5]; if(hr < 10) { if(mn < 10) snprintf(tm, sizeof(tm), PSTR("%c%d0%d"), z, hr, mn); else snprintf(tm, sizeof(tm), PSTR("%c%d%d"), z, hr, mn); @@ -659,20 +640,20 @@ void showTime() { \*********************************************************************************************/ bool TM1637Cmd(uint8_t fn) { bool result = false; - NUM_DIGITS = Settings.display_size; - if(prev_num_digits != NUM_DIGITS) { // Cleck for change of display size, and re-init the library - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: Size changed. Re-initializing library...")); + TM1637Data.num_digits = Settings.display_size; + if(TM1637Data.prev_num_digits != TM1637Data.num_digits) { // Cleck for change of display size, and re-init the library + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: Size changed. Re-initializing library...")); display = new SevenSegmentTM1637(Pin(GPIO_SSPI_SCLK), Pin(GPIO_SSPI_MOSI) ); - display->begin(NUM_DIGITS, 1); + display->begin(TM1637Data.num_digits, 1); display->setBacklight(40); - clearDisplay(); - prev_num_digits = NUM_DIGITS; - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: Re-initialized library")); + TM1637ClearDisplay(); + TM1637Data.prev_num_digits = TM1637Data.num_digits; + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: Re-initialized library")); } if(XdrvMailbox.data_len > CMD_MAX_LEN) { - sprintf(msg, PSTR("Command text too long. Please limit it to %d characters"), CMD_MAX_LEN); - XdrvMailbox.data = msg; + sprintf(TM1637Data.msg, PSTR("Command text too long. Please limit it to %d characters"), CMD_MAX_LEN); + XdrvMailbox.data = TM1637Data.msg; return result; } @@ -731,17 +712,17 @@ bool Xdsp15(uint8_t function) bool result = false; if (FUNC_DISPLAY_INIT_DRIVER == function) { - result = TM1637Init(); // init + TM1637Init(); // init } else if (XDSP_15 == Settings.display_model) { switch (function) { case FUNC_DISPLAY_MODEL: - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: FUNC_DISPLAY_MODEL")); + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: FUNC_DISPLAY_MODEL")); result = true; break; case FUNC_DISPLAY_INIT: CmndTM1637Clear(); - AddLog(LOG_LEVEL_DEBUG, PSTR("LOG: TM1637: FUNC_DISPLAY_INIT")); + AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: FUNC_DISPLAY_INIT")); break; case FUNC_DISPLAY_SEVENSEG_TEXT: case FUNC_DISPLAY_CLEAR: @@ -759,9 +740,9 @@ bool Xdsp15(uint8_t function) result = TM1637Cmd(function); break; case FUNC_DISPLAY_EVERY_50_MSECOND: - scrollText(); - if(showClock) { - showTime(); + TM1637ScrollText(); + if(TM1637Data.show_clock) { + TM1637ShowTime(); } break; } diff --git a/tasmota/xsns_28_tm1638.ino b/tasmota/xsns_28_tm1638.ino index 44da51dde..0eb0d1744 100644 --- a/tasmota/xsns_28_tm1638.ino +++ b/tasmota/xsns_28_tm1638.ino @@ -21,7 +21,7 @@ /*********************************************************************************************\ * TM1638 8 switch, led and 7 segment * - * Uses GPIO TM16 DIO, TM16 CLK and TM16 STB + * Uses GPIO TM1638 DIO, TM1638 CLK and TM1638 STB \*********************************************************************************************/ #define XSNS_28 28