d1_mini_pro-sensor-mqtt/lib/HomeAssistantDevices/HALightBrightness.hpp

27 lines
781 B
C++
Raw Normal View History

2022-12-30 18:31:20 +03:00
#pragma once
#include <HALight.hpp>
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;
};
class HALightBrightness : public virtual HALight {
2022-12-30 18:31:20 +03:00
private:
HALightBrightnessController *light;
protected:
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);
};