Add basic exchange of relay states
This commit is contained in:
		
							parent
							
								
									0460e838bc
								
							
						
					
					
						commit
						8a83602d6a
					
				
					 10 changed files with 153 additions and 41 deletions
				
			
		| 
						 | 
				
			
			@ -31,7 +31,15 @@ impl ControllerWs {
 | 
			
		|||
		block_on(controller_db.update_active(conn, true))?;
 | 
			
		||||
 | 
			
		||||
		for relay in &controller.relays {
 | 
			
		||||
			log::debug!("Registering relay: {}", relay.r.name);
 | 
			
		||||
			log::debug!(
 | 
			
		||||
				"Registering relay: {} ({})",
 | 
			
		||||
				relay.r.name,
 | 
			
		||||
				match relay.is_on {
 | 
			
		||||
					Some(true) => "+",
 | 
			
		||||
					Some(false) => "-",
 | 
			
		||||
					None => "?",
 | 
			
		||||
				}
 | 
			
		||||
			);
 | 
			
		||||
			let (new_relay, created) = block_on(DbRelay::get_by_controller_and_num_or_create(
 | 
			
		||||
				conn,
 | 
			
		||||
				&controller_db,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue