Philiphs Hue Improvments (#472)

* patch and improve philiphshue

* cleanup

* cleanup

* cleanup

* LedDevice switchOn()

* add signal for on/off to ledDevice
This commit is contained in:
brindosch
2017-09-16 00:18:17 +02:00
committed by GitHub
parent 81f5f51257
commit 74ff5c7ada
5 changed files with 268 additions and 261 deletions

View File

@@ -40,11 +40,14 @@ public:
///
virtual ~LedDevice() {}
/// Switch the leds off
/// Switch the leds off (led hardware disable)
virtual int switchOff();
/// Switch the leds on (led hardware enable), used if reinitialization is required for the device implementation
virtual int switchOn();
virtual int setLedValues(const std::vector<ColorRgb>& ledValues);
///
/// Opens and configures the output device
///
@@ -59,13 +62,20 @@ public:
static QJsonObject getLedDeviceSchemas();
static void setLedCount(int ledCount);
static int getLedCount() { return _ledCount; }
void setEnable(bool enable);
bool enabled() { return _enabled; };
int getLatchTime() { return _latchTime_ms; };
inline bool componentState() { return enabled(); };
signals:
///
/// Emits whenever the led device switches between on/off
/// @param newState The new state of the device
///
void enableStateChanged(bool newState);
protected:
///
/// Writes the RGB-Color values to the leds.