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