mirror of https://github.com/arendst/Tasmota.git
Merge pull request #13779 from hallard/teleinfo_fix
Teleinfo use hardware energy counters
This commit is contained in:
commit
f5a86f4b88
|
@ -149,6 +149,7 @@ class TInfo
|
|||
uint8_t valuesDump(void);
|
||||
char * valueGet(char * name, char * value);
|
||||
char * valueGet_P(const char * name, char * value);
|
||||
int labelCount();
|
||||
boolean listDelete();
|
||||
unsigned char calcChecksum(char *etiquette, char *valeur, char *horodate=NULL) ;
|
||||
|
||||
|
@ -157,7 +158,6 @@ class TInfo
|
|||
ValueList * valueAdd (char * name, char * value, uint8_t checksum, uint8_t * flags, char * horodate=NULL);
|
||||
boolean valueRemove (char * name);
|
||||
boolean valueRemoveFlagged(uint8_t flags);
|
||||
int labelCount();
|
||||
uint32_t horodate2Timestamp( char * pdate) ;
|
||||
void customLabel( char * plabel, char * pvalue, uint8_t * pflags) ;
|
||||
ValueList * checkLine(char * pline) ;
|
||||
|
|
|
@ -357,6 +357,7 @@ void DataCallback(struct _ValueList * me, uint8_t flags)
|
|||
|
||||
Energy.import_active[0] = total/1000.0f;
|
||||
EnergyUpdateTotal();
|
||||
AddLog (LOG_LEVEL_INFO, PSTR ("TIC: Total counter updated to %u Wh"), total);
|
||||
}
|
||||
|
||||
// Wh total index (standard)
|
||||
|
@ -568,6 +569,9 @@ void TInfoDrvInit(void) {
|
|||
TasmotaGlobal.energy_driver = XNRG_15;
|
||||
Energy.voltage_available = false;
|
||||
Energy.phase_count = 1;
|
||||
// init hardware energy counters
|
||||
Settings->flag3.hardware_energy_total = true;
|
||||
Settings->energy_kWhtotal = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue