Included presence check, changed to XSNS_86 and hopefully solved language file conflicts.

This commit is contained in:
RaphDaMan 2021-03-22 21:59:36 +01:00 committed by Raphael
parent f6c50e30fa
commit 04c0b8d1d7
26 changed files with 52 additions and 48 deletions

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Stroom L1+L2+L3"
#define D_SpL1L2L3 "Spanning L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -584,7 +584,7 @@
#define D_StL1L2L3 "Ток L1+L2+L3"
#define D_SpL1L2L3 "Напрежение L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Ströme L1+L2+L3"
#define D_SpL1L2L3 "Spannung L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signalstärke"
#define D_CHIPTEMPERATURE "Chip Temperatur"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Corriente L1+L2+L3"
#define D_SpL1L2L3 "Voltaje L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Streame L1+L2+L3"
#define D_SpL1L2L3 "Foltaazje L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Áramerősség L1+L2+L3"
#define D_SpL1L2L3 "Feszültség L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Corrente L1+L2+L3"
#define D_SpL1L2L3 "Tensione L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Stroom L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Prąd suma"
#define D_SpL1L2L3 "Prąd średni"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Corrente F1+F2+F3"
#define D_SpL1L2L3 "Tensão F1+F2+F3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Dòng L1+L2+L3"
#define D_SpL1L2L3 "Điện áp L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -585,7 +585,7 @@
#define D_StL1L2L3 "Current L1+L2+L3"
#define D_SpL1L2L3 "Voltage L1+L2+L3/3"
// xsns_88_tfminiplus.ino
// xsns_86_tfminiplus.ino
#define D_SIGNALSTRENGTH "Signal Strength"
#define D_CHIPTEMPERATURE "Chip Temperature"

View File

@ -1,5 +1,5 @@
/*
xsns_88_tfminiplus.ino - TFmini Plus interface for Tasmota
xsns_86_tfminiplus.ino - TFmini Plus interface for Tasmota
Created by Raphael Breiting on 12.11.2020.
@ -68,7 +68,7 @@
#include <TasmotaSerial.h>
// Define driver ID
#define XSNS_88 88
#define XSNS_86 86
// Use special no wait serial driver, should be always on
#ifndef ESP32
@ -83,7 +83,7 @@
char Tfmp_buffer[TFMP_MAX_DATA_LEN + 1];
struct xsns_88_tfminiplus
struct xsns_86_tfminiplus
{
bool ready = false;
uint16_t distance = 0;
@ -216,30 +216,34 @@ void TfmpShow(bool json)
* Interface
\*********************************************************************************************/
bool Xsns88(byte callback_id)
bool Xsns86(byte callback_id)
{
bool result = false;
switch (callback_id) {
case FUNC_INIT:
TfmpInit();
break;
case FUNC_EVERY_SECOND:
TfmpTrigger();
TfmpProcessSerialData();
result = true;
break;
case FUNC_JSON_APPEND:
TfmpShow(1);
break;
if (FUNC_INIT == callback_id)
{
TfmpInit();
}
else if (TfmpSerial && tfminiplus_sensor.ready)
{
switch (callback_id) {
case FUNC_EVERY_SECOND:
TfmpTrigger();
TfmpProcessSerialData();
result = true;
break;
case FUNC_JSON_APPEND:
TfmpShow(1);
break;
#ifdef USE_WEBSERVER
case FUNC_WEB_SENSOR:
TfmpShow(0);
break;
case FUNC_WEB_SENSOR:
TfmpShow(0);
break;
#endif // USE_WEBSERVER
case FUNC_SAVE_BEFORE_RESTART:
break;
case FUNC_COMMAND:
break;
case FUNC_SAVE_BEFORE_RESTART:
break;
case FUNC_COMMAND:
break;
}
}
return result;
}