debug forcevent

This commit is contained in:
2026-05-18 23:28:30 +02:00
parent fcfaf065ea
commit ea60250609
2 changed files with 12 additions and 11 deletions
+1 -1
View File
@@ -15,7 +15,7 @@
#define CLIENT_ID "Client_ID"
uint debugLevel = DEBUG |INFO | ERROR | ALERT;
uint debugLevel = INFO | ERROR | ALERT;
QByteArray toFollow;
#ifdef WITH_MQTT
+11 -10
View File
@@ -132,9 +132,8 @@ void Pws2mqtt::init()
debug(DEBUGMACRO, "Request query is empty", WARNING);
}else
{
debug(DEBUGMACRO, "Request query :" + request.query().toString() , INFO
);
/* QMetaObject::invokeMethod(this, [this, query = request.query()]() {
debug(DEBUGMACRO, "Request query :" + request.query().toString() , INFO);
/*QMetaObject::invokeMethod(this, [this, query = request.query()]() {
this->parseData(query.queryItems());
}, Qt::QueuedConnection);*/
parseData(request.query().queryItems());
@@ -334,7 +333,6 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
{
if (propertiesValue[name] < forceVent[i][0].toUInt())
{
i -= 1;
msg = forceVent[i][1].toString();
windPriority = forceVent[i][2].toUInt();
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";
propertiesValue["forcevent"] = i;
debug (DEBUGMACRO, propertyList[name], DEBUG);
if (i >= 7)
{
debug (DEBUGMACRO, "i >= 7", DEBUG);
if (announced[name] != windPriority)
{
notify (propertyList[name], priorityList[windPriority]);
announced[name] = windPriority;
debug (DEBUGMACRO, "Notifying : " + propertyList[name], DEBUG);
break;
}
}else
@@ -479,28 +480,28 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
{
//notif += formatNotifString (propertyName[name].first, propertyName[name].second , value);
if (propertyValue == 5 )
/*if (propertyValue == 5 )
priority[name] = setPriority (priority[name], 4);
if (propertyValue >= 6 )
priority[name] = setPriority (priority[name], 5);
*/
propertiesValue[name] = propertyValue;
//debug (DEBUGMACRO, "Notif = #" + notif + "#", DEBUG);
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]]);
announced[name] = priority[name];
announced[name] = propertyValue;
debug (DEBUGMACRO, "Notifying : " + name + " is " + QString::number(propertyValue), DEBUG);
}
}else
{
announced[name] = 0;
}
}
debug (DEBUGMACRO, "priority = " + QString::number(priority[name]), DEBUG);
}else if (name == "solarradiation")
{
propertyValue = round(pair.second.toFloat()*100)/100.0;