add: status for mqtt
fix: refactor connection handlers
This commit is contained in:
		
							parent
							
								
									2bc11ee829
								
							
						
					
					
						commit
						6c6e5023da
					
				
					 19 changed files with 534 additions and 183 deletions
				
			
		| 
						 | 
				
			
			@ -17,6 +17,7 @@ typedef struct
 | 
			
		|||
    int number;
 | 
			
		||||
    int controller_id;
 | 
			
		||||
    int active_schedule_id;
 | 
			
		||||
    int is_on;
 | 
			
		||||
    schedule_t *active_schedule;
 | 
			
		||||
    schedule_t *schedules[7];
 | 
			
		||||
} relay_t;
 | 
			
		||||
| 
						 | 
				
			
			@ -24,14 +25,14 @@ typedef struct
 | 
			
		|||
int
 | 
			
		||||
relay_save();
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
relay_remove();
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
relay_reload_active_schedule(relay_t *relay);
 | 
			
		||||
 | 
			
		||||
cJSON*
 | 
			
		||||
relay_to_json();
 | 
			
		||||
relay_to_json(relay_t *relay);
 | 
			
		||||
 | 
			
		||||
cJSON*
 | 
			
		||||
relay_list_to_json(relay_t **relays);
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
relay_free(relay_t *relay);
 | 
			
		||||
| 
						 | 
				
			
			@ -39,9 +40,6 @@ relay_free(relay_t *relay);
 | 
			
		|||
void
 | 
			
		||||
relay_free_list(relay_t **relays_list);
 | 
			
		||||
 | 
			
		||||
relay_t**
 | 
			
		||||
relay_get_by_simple(const char *key, const void *value, intptr_t bind_func, int bind_func_param);
 | 
			
		||||
 | 
			
		||||
relay_t*
 | 
			
		||||
relay_get_by_id(int id);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue