Const correctness, override keyword, a bunch of stuff..

This commit is contained in:
Murat
2020-08-08 23:12:43 +02:00
parent 4099d12d9a
commit 4a688b932a
144 changed files with 622 additions and 566 deletions

View File

@@ -49,8 +49,6 @@ public:
API_NOTIFICATION,
};
explicit YeelightResponse() {}
API_REPLY error() const { return _error;}
void setError(const YeelightResponse::API_REPLY replyType) { _error = replyType; }
@@ -79,7 +77,6 @@ class YeelightLight
{
public:
enum API_EFFECT{
API_EFFECT_SMOOTH,
API_EFFECT_SUDDEN
@@ -281,7 +278,7 @@ public:
///
/// @return True, if success
///
virtual bool restoreState();
bool restoreState();
///
/// @brief Check, if light was originally powered on before hyperion color streaming started..
@@ -428,7 +425,7 @@ public:
///
/// @brief Destructor of the LedDevice
///
virtual ~LedDeviceYeelight() override;
~LedDeviceYeelight() override;
///
/// @brief Constructs the LED-device
@@ -443,7 +440,7 @@ public:
///
/// @return A JSON structure holding a list of devices found
///
virtual QJsonObject discover() override;
QJsonObject discover() override;
///
/// @brief Get a Yeelight device's resource properties
@@ -459,7 +456,7 @@ public:
/// @param[in] params Parameters to query device
/// @return A JSON structure holding the device's properties
///
virtual QJsonObject getProperties(const QJsonObject& params) override;
QJsonObject getProperties(const QJsonObject& params) override;
///
/// @brief Send an update to the Yeelight device to identify it.
@@ -474,7 +471,7 @@ public:
///
/// @param[in] params Parameters to address device
///
virtual void identify(const QJsonObject& params) override;
void identify(const QJsonObject& params) override;
protected:
@@ -484,21 +481,21 @@ protected:
/// @param[in] deviceConfig the JSON device configuration
/// @return True, if success
///
virtual bool init(const QJsonObject &deviceConfig) override;
bool init(const QJsonObject &deviceConfig) override;
///
/// @brief Opens the output device.
///
/// @return Zero on success (i.e. device is ready), else negative
///
virtual int open() override;
int open() override;
///
/// @brief Closes the output device.
///
/// @return Zero on success (i.e. device is closed), else negative
///
virtual int close() override;
int close() override;
///
/// @brief Writes the RGB-Color values to the LEDs.
@@ -506,21 +503,21 @@ protected:
/// @param[in] ledValues The RGB-color per LED
/// @return Zero on success, else negative
///
virtual int write(const std::vector<ColorRgb> & ledValues) override;
int write(const std::vector<ColorRgb> & ledValues) override;
///
/// @brief Power-/turn on the Nanoleaf device.
///
/// @brief Store the device's original state.
///
virtual bool powerOn() override;
bool powerOn() override;
///
/// @brief Power-/turn off the Nanoleaf device.
///
/// @return True if success
///
virtual bool powerOff() override;
bool powerOff() override;
///
/// @brief Store the device's original state.
@@ -529,7 +526,7 @@ protected:
///
/// @return True if success
///
virtual bool storeState() override;
bool storeState() override;
///
/// @brief Restore the device's original state.
@@ -539,7 +536,7 @@ protected:
///
/// @return True, if success
///
virtual bool restoreState() override;
bool restoreState() override;
private: