debug forcevent

This commit is contained in:
DTux committed 2026-05-18 23:28:30 +02:00
1 parent fcfaf065ea
commit ea60250609
2 files changed
+11 -10

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@
#define CLIENT_ID "Client_ID" #define CLIENT_ID "Client_ID"
uint debugLevel = DEBUG |INFO | ERROR | ALERT; uint debugLevel = INFO | ERROR | ALERT;
QByteArray toFollow; QByteArray toFollow;
#ifdef WITH_MQTT #ifdef WITH_MQTT
+10 -9
View File
@@ -132,8 +132,7 @@ void Pws2mqtt::init()
debug(DEBUGMACRO, "Request query is empty", WARNING); debug(DEBUGMACRO, "Request query is empty", WARNING);
}else }else
{ {
debug(DEBUGMACRO, "Request query :" + request.query().toString() , INFO debug(DEBUGMACRO, "Request query :" + request.query().toString() , INFO);
);
/*QMetaObject::invokeMethod(this, [this, query = request.query()]() { /*QMetaObject::invokeMethod(this, [this, query = request.query()]() {
this->parseData(query.queryItems()); this->parseData(query.queryItems());
}, Qt::QueuedConnection);*/ }, Qt::QueuedConnection);*/
@@ -334,7 +333,6 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
{ {
if (propertiesValue[name] < forceVent[i][0].toUInt()) if (propertiesValue[name] < forceVent[i][0].toUInt())
{ {
i -= 1;
msg = forceVent[i][1].toString(); msg = forceVent[i][1].toString();
windPriority = forceVent[i][2].toUInt(); windPriority = forceVent[i][2].toUInt();
break; break;
@@ -343,13 +341,16 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
propertyList[name] = "- Vent - " + msg + " : " + QByteArray::number(propertiesValue[name]) + " Km/h\n"; propertyList[name] = "- Vent - " + msg + " : " + QByteArray::number(propertiesValue[name]) + " Km/h\n";
propertiesValue["forcevent"] = i; propertiesValue["forcevent"] = i;
debug (DEBUGMACRO, propertyList[name], DEBUG);
if (i >= 7) if (i >= 7)
{ {
debug (DEBUGMACRO, "i >= 7", DEBUG);
if (announced[name] != windPriority) if (announced[name] != windPriority)
{ {
notify (propertyList[name], priorityList[windPriority]); notify (propertyList[name], priorityList[windPriority]);
announced[name] = windPriority; announced[name] = windPriority;
debug (DEBUGMACRO, "Notifying : " + propertyList[name], DEBUG);
break; break;
} }
}else }else
@@ -479,28 +480,28 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
{ {
//notif += formatNotifString (propertyName[name].first, propertyName[name].second , value); //notif += formatNotifString (propertyName[name].first, propertyName[name].second , value);
if (propertyValue == 5 ) /*if (propertyValue == 5 )
priority[name] = setPriority (priority[name], 4); priority[name] = setPriority (priority[name], 4);
if (propertyValue >= 6 ) if (propertyValue >= 6 )
priority[name] = setPriority (priority[name], 5); priority[name] = setPriority (priority[name], 5);
*/
propertiesValue[name] = propertyValue; propertiesValue[name] = propertyValue;
//debug (DEBUGMACRO, "Notif = #" + notif + "#", DEBUG); //debug (DEBUGMACRO, "Notif = #" + notif + "#", DEBUG);
propertyList[name] = "- UV - " + QByteArray::number(propertyValue) + "\n"; propertyList[name] = "- UV - " + QByteArray::number(propertyValue) + "\n";
if (priority[name] >= 4) if (propertyValue >= 5)
{ {
if (announced[name] != priority[name]) if (announced[name] != propertyValue)
{ {
notify (propertyList[name], priorityList[priority[name]]); notify (propertyList[name], priorityList[priority[name]]);
announced[name] = priority[name]; announced[name] = propertyValue;
debug (DEBUGMACRO, "Notifying : " + name + " is " + QString::number(propertyValue), DEBUG);
} }
}else }else
{ {
announced[name] = 0; announced[name] = 0;
} }
} }
debug (DEBUGMACRO, "priority = " + QString::number(priority[name]), DEBUG);
}else if (name == "solarradiation") }else if (name == "solarradiation")
{ {
propertyValue = round(pair.second.toFloat()*100)/100.0; propertyValue = round(pair.second.toFloat()*100)/100.0;