mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Implemented timeout for restoring original state.
Former-commit-id: 925b063aba1a859b592ead9b75ce67d90fb81e28
This commit is contained in:
@@ -13,6 +13,9 @@
|
||||
LedDevicePhilipsHue::LedDevicePhilipsHue(const std::string& output) :
|
||||
host(output.c_str()), username("newdeveloper") {
|
||||
http = new QHttp(host);
|
||||
timer.setInterval(1000);
|
||||
timer.setSingleShot(true);
|
||||
connect(&timer, SIGNAL(timeout()), this, SLOT(restoreStates()()));
|
||||
}
|
||||
|
||||
LedDevicePhilipsHue::~LedDevicePhilipsHue() {
|
||||
@@ -37,10 +40,12 @@ int LedDevicePhilipsHue::write(const std::vector<ColorRgb> & ledValues) {
|
||||
// Next light id.
|
||||
lightId++;
|
||||
}
|
||||
timer.start();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LedDevicePhilipsHue::switchOff() {
|
||||
timer.stop();
|
||||
// If light states have been saved before, ...
|
||||
if (statesSaved()) {
|
||||
// ... restore them.
|
||||
|
Reference in New Issue
Block a user