Add RGB light as a device.

This commit is contained in:
2025-05-03 11:50:44 +03:00
parent eab859ebe2
commit 1f217020d6
3 changed files with 197 additions and 1 deletions

View File

@@ -10,5 +10,17 @@
#include <stdbool.h>
#include <esp_err.h>
#define RGB_POWER_DEFAULT false
#define RGB_HUE_DEFAULT 180
#define RGB_SATURATION_DEFAULT 100
#define RGB_BRIGHTNESS_DEFAULT 25
extern esp_rmaker_device_t *light_device;
void app_driver_init(void);
esp_err_t app_driver_set_gpio(const char *name, bool state);
esp_err_t app_light_set(uint32_t hue, uint32_t saturation, uint32_t brightness);
esp_err_t app_light_set_power(bool power);
esp_err_t app_light_set_brightness(uint16_t brightness);
esp_err_t app_light_set_hue(uint16_t hue);
esp_err_t app_light_set_saturation(uint16_t saturation);