Add time to the sensor list widget, also broadcast and recive the time of a sensor
This commit is contained in:
parent
260334ef35
commit
a301bdbaa7
15 changed files with 557 additions and 266 deletions
|
|
@ -23,6 +23,7 @@ MainObject::MainObject(QIODevice* ioDevice, const QString& settingsPathIn, const
|
|||
QObject::connect(&ocupancySensor, &OcupancySensorSource::stateChanged, &globalSensors, &SensorStore::sensorGotState);
|
||||
|
||||
sunSensorSource.run();
|
||||
//pwHandler.startLoop();
|
||||
|
||||
//connect item store
|
||||
QObject::connect(µ, &Microcontroller::gotRelayList, &items, &ItemStore::addItems);
|
||||
|
|
@ -35,14 +36,17 @@ MainObject::MainObject(QIODevice* ioDevice, const QString& settingsPathIn, const
|
|||
items.addItem(auxItem);
|
||||
MessageItem::broadCast = &broadCast;
|
||||
|
||||
|
||||
Relay::setMicrocontroller(µ);
|
||||
|
||||
connect(&broadCast, &BroadCast::gotJson, this, &MainObject::recivedJson);
|
||||
QObject::connect(&broadCast, &BroadCast::gotSensorState, &globalSensors, &SensorStore::sensorGotState);
|
||||
if(master)connect(&broadCast, &BroadCast::jsonRequested, this, &MainObject::sendJson);
|
||||
if(master)
|
||||
connect(&broadCast, &BroadCast::jsonRequested, this, &MainObject::sendJson);
|
||||
|
||||
if(master) load(getJsonObjectFromDisk(settingsPath, &noSave));
|
||||
if(master)
|
||||
{
|
||||
load(getJsonObjectFromDisk(settingsPath, &noSave));
|
||||
}
|
||||
else
|
||||
{
|
||||
broadCast.requestJson();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue