add qpiri as a configurable value

This commit is contained in:
Raphael Pertl
2020-02-22 22:21:11 +01:00
parent ebd3bbe2bc
commit 35a09bb538
4 changed files with 8 additions and 1 deletions
+2
View File
@@ -21,3 +21,5 @@ amperage_factor=1.0
# This allos you to modify the wattage in case the inverter is giving an incorrect
# reading compared to measurement tools. Normally this will remain '1'
watt_factor=1.01
qpiri=97
+1 -1
View File
@@ -176,7 +176,7 @@ void cInverter::poll() {
// Reading QPIRI status
if (!ups_qpiri_changed) {
if (query("QPIRI", 97)) {
if (query("QPIRI", qpiri)) {
m.lock();
strcpy(status2, (const char*)buf+1);
m.unlock();
+2
View File
@@ -34,6 +34,8 @@ class cInverter {
string *GetQpigsStatus();
string *GetWarnings();
int qpiri;
int GetMode();
void ExecuteCmd(const std::string cmd);
};
+3
View File
@@ -43,6 +43,7 @@ string devicename;
int runinterval;
float ampfactor;
float wattfactor;
int qpiri;
// ---------------------------------------
@@ -90,6 +91,8 @@ void getSettingsFile(string filename) {
attemptAddSetting(&wattfactor, linepart2);
else if(linepart1 == "watt_factor")
attemptAddSetting(&wattfactor, linepart2);
else if(linepart1 == "qpiri")
attemptAddSetting(&qpiri, linepart2);
else
continue;
}