mirror of https://github.com/arendst/Tasmota.git
Add Energy->phase_count_virtual
This commit is contained in:
parent
52392a2b48
commit
ca452c5e43
|
@ -109,6 +109,7 @@ typedef struct {
|
|||
uint8_t data_valid[ENERGY_MAX_PHASES];
|
||||
|
||||
uint8_t phase_count; // Number of phases active
|
||||
uint8_t phase_count_virtual; // Number of virtual relays
|
||||
bool voltage_common; // Use common voltage
|
||||
bool frequency_common; // Use common frequency
|
||||
bool use_overtemp; // Use global temperature as overtemp trigger on internal energy monitor hardware
|
||||
|
|
|
@ -173,6 +173,7 @@ typedef struct {
|
|||
|
||||
uint8_t data_valid[ENERGY_MAX_PHASES];
|
||||
uint8_t phase_count; // Number of phases active
|
||||
uint8_t phase_count_virtual; // Number of virtual relays
|
||||
uint8_t fifth_second;
|
||||
uint8_t command_code;
|
||||
uint8_t power_steady_counter; // Allow for power on stabilization
|
||||
|
|
|
@ -148,8 +148,9 @@ bool NrgDummyCommand(void) {
|
|||
}
|
||||
|
||||
void NrgDummyDrvInit(void) {
|
||||
if (TasmotaGlobal.gpio_optiona.dummy_energy && TasmotaGlobal.devices_present) {
|
||||
Energy->phase_count = (TasmotaGlobal.devices_present < ENERGY_MAX_PHASES) ? TasmotaGlobal.devices_present : ENERGY_MAX_PHASES;
|
||||
uint32_t phase_count = (Energy->phase_count_virtual > 0) ? Energy->phase_count_virtual : TasmotaGlobal.devices_present;
|
||||
if (TasmotaGlobal.gpio_optiona.dummy_energy && phase_count) {
|
||||
Energy->phase_count = (phase_count < ENERGY_MAX_PHASES) ? phase_count : ENERGY_MAX_PHASES;
|
||||
|
||||
if (HLW_PREF_PULSE == EnergyGetCalibration(ENERGY_POWER_CALIBRATION)) {
|
||||
for (uint32_t i = 0; i < Energy->phase_count; i++) {
|
||||
|
|
Loading…
Reference in New Issue