Browse code

fix vibration

Louis Jonget authored on11/03/2024 17:26:51
Showing2 changed files
1 1
Binary files a/build/synocam_home_switch.pbw and b/build/synocam_home_switch.pbw differ
... ...
@@ -11,6 +11,7 @@ const uint32_t outbox_size = 64;
11 11
 
12 12
 static char s_auth[60];
13 13
 static char s_api[40];
14
+static char s_api_short[22];
14 15
 static char s_username[40];
15 16
 static char s_password[40];
16 17
 static char s_server[255];
... ...
@@ -280,11 +281,14 @@ static void inbox_received_callback(DictionaryIterator *iter, void *context) {
280 281
     strncpy(s_api, api_tuple->value->cstring, 40);
281 282
     // Display in the TextLayer
282 283
     text_layer_set_text(s_text_layer, s_api);
283
-    if(strcmp(s_api, "Home mode is ON (camera is off)")==0){
284
+    strncpy(s_api_short, s_api, 22);
285
+    if(strcmp(s_api_short, "Home mode is ON")==0){
284 286
       vibes_short_pulse();
285
-    }else if(strcmp(s_api, "Home mode is OFF (camera is on)")==0){
287
+    }else if(strcmp(s_api_short, "Home mode is OFF")==0){
286 288
       vibes_double_pulse();
287
-    }else if(strcmp(s_api,"Time out too many times, verify settings")==0){
289
+    }else if(strcmp(s_api_short, "Home mode is ON until ")==0){
290
+      vibes_double_pulse();
291
+    }else if(strcmp(s_api_short,"Timeout too many times")==0){
288 292
       vibes_long_pulse();
289 293
     }
290 294
     APP_LOG(APP_LOG_LEVEL_DEBUG, "status message received ... ");