debugging tempf and UV
This commit is contained in:
+12
-7
@@ -276,26 +276,29 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
|
|||||||
propertyList[name] = formatNotifString(propertyName[name], QByteArray::number(propertyValue));
|
propertyList[name] = formatNotifString(propertyName[name], QByteArray::number(propertyValue));
|
||||||
propertiesValue[name] = propertyValue;
|
propertiesValue[name] = propertyValue;
|
||||||
debug (DEBUGMACRO, name + " : " + QByteArray::number(propertyValue) + " announced = " + QByteArray::number(announced[name]), DEBUG);
|
debug (DEBUGMACRO, name + " : " + QByteArray::number(propertyValue) + " announced = " + QByteArray::number(announced[name]), DEBUG);
|
||||||
if (qRound(propertyValue) >= 35)
|
quint8 valueRounded = qRound(propertyValue + 0.5);
|
||||||
|
QString alertString = formatNotifString(propertyName[name], QByteArray::number(valueRounded));
|
||||||
|
|
||||||
|
if (valueRounded >= 35)
|
||||||
{
|
{
|
||||||
if (announced[name] != 5)
|
if (announced[name] != 5)
|
||||||
{
|
{
|
||||||
debug(DEBUGMACRO, "Nofifying external temp >= 35°C", DEBUG);
|
debug(DEBUGMACRO, "Nofifying external temp >= 35°C", DEBUG);
|
||||||
notify (propertyList[name], priorityList[5]);
|
notify (alertString, priorityList[5]);
|
||||||
announced[name] = 5;
|
announced[name] = 5;
|
||||||
}
|
}
|
||||||
}else if (qRound(propertyValue) >= 27)
|
}else if (qRound(propertyValue + 0.5) >= 27)
|
||||||
{
|
{
|
||||||
if (announced[name] != 4)
|
if (announced[name] != 4)
|
||||||
{
|
{
|
||||||
debug(DEBUGMACRO, "Nofifying external temp >= 27°C", DEBUG);
|
debug(DEBUGMACRO, "Nofifying external temp >= 27°C", DEBUG);
|
||||||
notify (propertyList[name], priorityList[4]);
|
notify (alertString, priorityList[4]);
|
||||||
announced[name] = 4;
|
announced[name] = 4;
|
||||||
}
|
}
|
||||||
}else if (announced[name] != 0)
|
}else if (announced[name] != 0)
|
||||||
{
|
{
|
||||||
debug(DEBUGMACRO, "Nofifying external temp < 27°C", DEBUG);
|
debug(DEBUGMACRO, "Nofifying external temp < 27°C", DEBUG);
|
||||||
notify (propertyList[name], priorityList[4]);
|
notify (alertString, priorityList[4]);
|
||||||
announced[name] = 0;
|
announced[name] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -487,7 +490,7 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
|
|||||||
//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 (propertyValue >= 5)
|
if (propertyValue > 5)
|
||||||
{
|
{
|
||||||
if (announced[name] != propertyValue)
|
if (announced[name] != propertyValue)
|
||||||
{
|
{
|
||||||
@@ -497,7 +500,9 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
|
|||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
|
notify (propertyList[name], priorityList[priority[name]]);
|
||||||
announced[name] = 0;
|
announced[name] = 0;
|
||||||
|
debug (DEBUGMACRO, "Notifying : " + name + " is " + QString::number(propertyValue), DEBUG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if (name == "solarradiation")
|
}else if (name == "solarradiation")
|
||||||
@@ -550,7 +555,7 @@ void Pws2mqtt::parseData(QList<std::pair<QString, QString>> queryList)
|
|||||||
debug(DEBUGMACRO, "looping to fill notif", DEBUG);
|
debug(DEBUGMACRO, "looping to fill notif", DEBUG);
|
||||||
|
|
||||||
QTime currentTime = QTime::currentTime();
|
QTime currentTime = QTime::currentTime();
|
||||||
if (currentTime.minute() == 0 or start == false)
|
if ((currentTime.minute() == 0 and currentTime.second() <= 30)or start == false)
|
||||||
{
|
{
|
||||||
timer = QDateTime::currentDateTime();
|
timer = QDateTime::currentDateTime();
|
||||||
start = true;
|
start = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user