mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
41af5c1b9e
* 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
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
#ifndef LEDEVICEKARATE_H
|
|
#define LEDEVICEKARATE_H
|
|
|
|
// hyperion includes
|
|
#include "ProviderRs232.h"
|
|
|
|
///
|
|
/// Implementation of the LedDevice interface for writing to serial device
|
|
///
|
|
class LedDeviceKarate : public ProviderRs232
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
|
|
///
|
|
/// @brief Constructs a Karate LED-device
|
|
///
|
|
/// @param deviceConfig Device's configuration as JSON-Object
|
|
///
|
|
explicit LedDeviceKarate(const QJsonObject &deviceConfig);
|
|
|
|
///
|
|
/// @brief Constructs the LED-device
|
|
///
|
|
/// @param[in] deviceConfig Device's configuration as JSON-Object
|
|
/// @return LedDevice constructed
|
|
static LedDevice* construct(const QJsonObject &deviceConfig);
|
|
|
|
///
|
|
/// @brief Get a Karate device's resource properties
|
|
///
|
|
/// @param[in] params Parameters to query device
|
|
/// @return A JSON structure holding the device's properties
|
|
///
|
|
QJsonObject getProperties(const QJsonObject& params) override;
|
|
|
|
private:
|
|
|
|
///
|
|
/// @brief Initialise the device's configuration
|
|
///
|
|
/// @param[in] deviceConfig the JSON device configuration
|
|
/// @return True, if success
|
|
///
|
|
bool init(const QJsonObject &deviceConfig) override;
|
|
|
|
/// @brief Writes the RGB-Color values to the LEDs.
|
|
///
|
|
/// @param[in] ledValues The RGB-color per LED
|
|
/// @return Zero on success, else negative
|
|
///
|
|
int write(const std::vector<ColorRgb> &ledValues) override;
|
|
};
|
|
|
|
#endif // LEDEVICEKARATE_H
|