From bbcb8d635f4c83a0a7f27bd6d3e554781780d27e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 10 Nov 2018 23:36:11 +0100 Subject: Add ability to mirror messages from thermostat to power-controller --- control/application.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'control') 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) { -- cgit v1.2.3