Skip to content

Commit

Permalink
Fix a bug in HomeKit library was not not setting the characteristic
Browse files Browse the repository at this point in the history
value data structure correctly leading to bad characteristic updates
  • Loading branch information
jgstroud committed Jun 17, 2024
1 parent 56f67e9 commit ec3f942
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
; https://docs.platformio.org/page/projectconf.html

[env]
upload_speed = 921600
; upload_speed = 921600
monitor_speed = 115200 ; must remain at 115200 for improv
;monitor_speed = 74880 ; hardware default
board_build.filesystem = littlefs
Expand All @@ -35,7 +35,7 @@ build_flags =
; -D DEBUG_UPDATER=Serial
monitor_filters = esp8266_exception_decoder
lib_deps =
https://github.com/dkerr64/Arduino-HomeKit-ESP8266.git#8aa1307481d0b69f50b1709130e33620bbe85d9a
https://github.com/dkerr64/Arduino-HomeKit-ESP8266.git#2e49ed2dcec521d2b6f9969974abbaa0bdd42e58
https://github.com/jgstroud/EspSaveCrash.git#cf2803abfa51a83c93548f2591d4564a47845a72
esphome/Improv@^1.2.3
https://github.com/ratgdo/espsoftwareserial.git#autobaud
Expand Down
18 changes: 8 additions & 10 deletions src/comms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,16 +564,14 @@ void comms_loop() {

RINFO("tgt %d curr %d", target_state, current_state);

//Homekit seems to miss the closed state change so revert this check for now
//if (target_state != garage_door.target_state) {
garage_door.target_state = target_state;
notify_homekit_target_door_state_change();
//}

//if (current_state != garage_door.current_state) {
garage_door.current_state = current_state;
notify_homekit_current_door_state_change();
//}
if ((target_state != garage_door.target_state) ||
(current_state != garage_door.current_state)) {
garage_door.target_state = target_state;
garage_door.current_state = current_state;

notify_homekit_current_door_state_change();
notify_homekit_target_door_state_change();
}

if (pkt.m_data.value.status.light != garage_door.light) {
RINFO("Light Status %s", pkt.m_data.value.status.light ? "On" : "Off");
Expand Down

0 comments on commit ec3f942

Please sign in to comment.