Add switch device.

This commit is contained in:
2025-05-27 11:44:44 +03:00
parent ebaebef24c
commit 45d644c54c
3 changed files with 102 additions and 14 deletions

View File

@@ -15,7 +15,13 @@
#define RGB_SATURATION_DEFAULT 100
#define RGB_BRIGHTNESS_DEFAULT 25
#define GPIO_DEVICE_OUT1_NAME "Output-1"
#define GPIO_DEVICE_OUT2_NAME "Output-2"
#define GPIO_DEVICE_OUT3_NAME "Output-3"
extern esp_rmaker_device_t *gpio_device;
extern esp_rmaker_device_t *light_device;
extern esp_rmaker_device_t *switch_device;
void app_driver_init(void);
esp_err_t app_driver_set_gpio(const char *name, bool state);
@@ -23,4 +29,6 @@ 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);
esp_err_t app_light_set_saturation(uint16_t saturation);
int app_switch_set_state(bool state);
bool app_switch_get_state(void);