Migliora discovery e pubblicazione MQTT per inverter in cascata
Build Docker Image for Raspberry Pi / build-and-push (push) Successful in 9m22s

This commit is contained in:
Pi Developer
2026-02-10 21:59:47 +01:00
parent 61567e3326
commit 9e72d4f5a7
6 changed files with 696 additions and 128 deletions
+22
View File
@@ -175,6 +175,7 @@ int main(int argc, char* argv[]) {
// Get command flag settings from the arguments (if any)
InputParser cmdArgs(argc, argv);
const string &rawcmd = cmdArgs.getCmdOption("-r");
const string &parallelDataCount = cmdArgs.getCmdOption("-P");
if(cmdArgs.cmdOptionExists("-h") || cmdArgs.cmdOptionExists("--help")) {
return print_help();
@@ -209,6 +210,27 @@ int main(int argc, char* argv[]) {
exit(0);
}
// Parallel inverter QPGS read (single session)
if(cmdArgs.cmdOptionExists("-P") || cmdArgs.cmdOptionExists("--parallel-qpgs")) {
int count = 2;
if (!parallelDataCount.empty()) {
try {
count = stoi(parallelDataCount);
} catch (...) {
count = 2;
}
}
vector<string> replies;
int ok = ups->QueryParallelQpgs(count, replies);
printf("PARALLEL_COUNT=%d\n", count);
for (int i = 0; i < count; i++) {
printf("QPGS%d_REPLY=%s\n", i, replies[i].c_str());
}
printf("PARALLEL_OK=%d\n", ok);
exit(0);
}
// Logic to send 'raw commands' to the inverter..
if (!rawcmd.empty()) {
ups->ExecuteCmd(rawcmd);