2022-12-30 18:31:20 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <HALight.hpp>
|
|
|
|
|
2023-01-18 19:23:01 +03:00
|
|
|
class HALightBrightnessController: public virtual HALightController {
|
2022-12-30 18:31:20 +03:00
|
|
|
public:
|
|
|
|
virtual void setBrightness(int value) = 0;
|
|
|
|
virtual int getBrightness() = 0;
|
|
|
|
|
|
|
|
virtual int getBrightnessScale() = 0;
|
|
|
|
};
|
|
|
|
|
2023-01-18 19:23:01 +03:00
|
|
|
class HALightBrightness : public virtual HALight {
|
2022-12-30 18:31:20 +03:00
|
|
|
private:
|
|
|
|
HALightBrightnessController *light;
|
|
|
|
|
|
|
|
protected:
|
2023-01-18 19:23:01 +03:00
|
|
|
virtual JSON_DOCUMENT_TYPE patchConfigJSON(JSON_DOCUMENT_TYPE &doc) override;
|
|
|
|
virtual JSON_DOCUMENT_TYPE patchStateJSON(JSON_DOCUMENT_TYPE &doc) override;
|
|
|
|
virtual void innerHandler(const JSON_DOCUMENT_TYPE &doc) override;
|
|
|
|
|
|
|
|
void handleBrightness(const JSON_DOCUMENT_TYPE &doc);
|
|
|
|
|
2022-12-30 18:31:20 +03:00
|
|
|
public:
|
|
|
|
HALightBrightness(PubSubClient &client, const char *name, const char *unique_id,
|
|
|
|
HALightBrightnessController &baseLight);
|
|
|
|
};
|