fix(nodes): fixing switch device tree and wrong ordering of ble values

This commit is contained in:
adrien balleyguier
2026-05-05 15:23:38 +02:00
committed by Klagarge
parent 35fbe7c488
commit 6fd9959329
2 changed files with 2 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
buttons{
compatible = "gpio-keys";
window_switch: window_switch {
gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
gpios = <&sx1509b 0 GPIO_ACTIVE_LOW>;
label = "Window Switch";
};
};

View File

@@ -19,7 +19,6 @@ enum error_code supervisor_init(){
}else{}
}else{}
}else{}
// debug with led set -> init and blink led red
return ret;
}
@@ -37,7 +36,7 @@ enum error_code supervisor_run(){
window_status = window_get_value(&window_value);
// maybe change arguments order
// todo : manage special values
ble_advertise(co2_lvl_value, hygro_value, thermo_value, window_status);
ble_advertise(window_value, hygro_value, thermo_value, co2_lvl_value);
if((co2_lvl_value > CO2_LEVEL_EMPTY_ROOM) || (window_value == open)){
// there are people in the room, or someone forgot to close the window
current_sleep_time = SLEEP_MIN_DURATION;