aboutsummaryrefslogtreecommitdiff
path: root/control
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-11-10 23:36:11 +0100
committerKarel Kočí <cynerd@email.cz>2018-11-12 19:34:52 +0100
commitbbcb8d635f4c83a0a7f27bd6d3e554781780d27e (patch)
treec7340360e0518360b51e8848281348ecc5758583 /control
parentcf452f0c431ba73719e0f3a356c78a43f74bf5ac (diff)
downloadbigclown-leds-bbcb8d635f4c83a0a7f27bd6d3e554781780d27e.tar.gz
bigclown-leds-bbcb8d635f4c83a0a7f27bd6d3e554781780d27e.tar.bz2
bigclown-leds-bbcb8d635f4c83a0a7f27bd6d3e554781780d27e.zip
Add ability to mirror messages from thermostat to power-controller
Diffstat (limited to 'control')
-rw-r--r--control/application.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/control/application.c b/control/application.c
index c14f5b1..ce14bf2 100644
--- a/control/application.c
+++ b/control/application.c
@@ -51,21 +51,26 @@ void tmp112_event_handler(bc_tmp112_t *self, bc_tmp112_event_t event, void *even
bc_scheduler_plan_now(APPLICATION_TASK_ID);
}
-void on_lcd_button_click(void) {
+int brightness = 0;
+
+void set_brightness() {
+ bc_radio_pub_int("led/brightness/set", &brightness);
}
void lcd_button_left_event_handler(bc_button_t *self, bc_button_event_t event, void *event_param) {
if (event != BC_BUTTON_EVENT_CLICK)
return;
bc_led_pulse(&led_lcd_blue, 30);
- on_lcd_button_click();
+ brightness = 100;
+ set_brightness();
}
void lcd_button_right_event_handler(bc_button_t *self, bc_button_event_t event, void *event_param) {
if (event != BC_BUTTON_EVENT_CLICK)
return;
bc_led_pulse(&led_lcd_red, 30);
- on_lcd_button_click();
+ brightness = 0;
+ set_brightness();
}
void battery_event_handler(bc_module_battery_event_t event, void *event_param) {