mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
LEDDevices - WLED enhancements and minor fixes (#1204)
* Yeelight minor updates
* Add Timeout to REST API
* LEDDevice - Correct storeState
* Add WaitTime function
* Always show HW-LEDCount for configuration
* WLED - New features ("live" support, storing state and identification)
* Yeelight - Refactoring
* Cololight - Refactoring
* Karate - getProperties Support
* Atmo - getProperties Support
* AtmoOrb - refactoring
* Nanoleaf - Refactoring, New "Shapes" considerations
* PhilipHue - Minor corrections
* Update Changelog
This commit is contained in:
27
include/utils/WaitTime.h
Normal file
27
include/utils/WaitTime.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef WAITTIME_H
|
||||
#define WAITTIME_H
|
||||
|
||||
#include <QEventLoop>
|
||||
#include <QTimer>
|
||||
|
||||
#include <chrono>
|
||||
|
||||
inline void wait(std::chrono::milliseconds millisecondsWait)
|
||||
{
|
||||
QEventLoop loop;
|
||||
QTimer t;
|
||||
t.connect(&t, &QTimer::timeout, &loop, &QEventLoop::quit);
|
||||
t.start(millisecondsWait.count());
|
||||
loop.exec();
|
||||
}
|
||||
|
||||
inline void wait(int millisecondsWait)
|
||||
{
|
||||
QEventLoop loop;
|
||||
QTimer t;
|
||||
t.connect(&t, &QTimer::timeout, &loop, &QEventLoop::quit);
|
||||
t.start(millisecondsWait);
|
||||
loop.exec();
|
||||
}
|
||||
|
||||
#endif // WAITTIME_H
|
||||
Reference in New Issue
Block a user