Added json broadcasting

This commit is contained in:
Carl Klemm 2019-06-10 23:22:08 +02:00
parent df27b622a0
commit 3cbe947408
37 changed files with 514 additions and 487 deletions

View file

@ -2,7 +2,7 @@
#include <QProcess>
#include <QApplication>
PowerItem::PowerItem(SensorStore* sensors, QApplication* a, uint32_t itemIdIn, QString name, uint8_t value, QObject* parent): Item(sensors, itemIdIn, name, value, parent), a_(a)
PowerItem::PowerItem(SensorStore* sensors, uint32_t itemIdIn, QString name, uint8_t value, QObject* parent): Item(sensors, itemIdIn, name, value, parent)
{
stateChanged(Sensor(Sensor::TYPE_SHUTDOWN_IMMINENT, 0, 0));
setValue(true);
@ -21,7 +21,6 @@ void PowerItem::setValue(uint8_t value)
void PowerItem::timeout()
{
QProcess::startDetached("syncoff");
a_->exit(0);
}
void PowerItem::store(QJsonObject& json)
@ -29,9 +28,3 @@ void PowerItem::store(QJsonObject& json)
json["Type"] = "Power";
Item::store(json);
}
void PowerItem::store(QString subsecton, QSettings* settings)
{
settings->setValue(subsecton + "Type", "Power");
Item::store(subsecton, settings);
}