add limit for write to leddevice (#432)

* add limit for write to leddevice

* add to default config

* add i18n

* extend xmas effect

* fix indention

* add check for minimum brightness

* adapt effects to fading and new minWriteTime

* remove old latchTime
rename minimumWriteTime to latchTime
make it as dev specific option

* set default for rewriteTime to 1s
pause smoothing on color too

* reenable smoothing for color - it looks nicer :-)

* fix timeout timer
This commit is contained in:
redPanther
2017-04-09 22:28:32 +02:00
committed by GitHub
parent d11dcf3640
commit b65d811640
62 changed files with 564 additions and 202 deletions

View File

@@ -62,6 +62,7 @@ public:
void setEnable(bool enable);
bool enabled() { return _enabled; };
int getLatchTime() { return _latchTime_ms; };
inline bool componentState() { return enabled(); };
@@ -93,15 +94,16 @@ protected:
/// Timer object which makes sure that led data is written at a minimum rate
/// e.g. Adalight device will switch off when it does not receive data at least every 15 seconds
QTimer _refresh_timer;
QTimer _refresh_timer;
unsigned int _refresh_timer_interval;
qint64 _last_write_time;
unsigned int _latchTime_ms;
protected slots:
/// Write the last data to the leds again
int rewriteLeds();
private:
std::vector<ColorRgb> _ledValues;
bool _componentRegistered;
bool _enabled;
bool _componentRegistered;
bool _enabled;
};