Add is_on functions
This commit is contained in:
		
							parent
							
								
									6414083af0
								
							
						
					
					
						commit
						0460e838bc
					
				
					 4 changed files with 32 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -50,10 +50,17 @@ async fn run_relays(app_state: &Addr<AppState>) -> Result<(), EmgauwaError> {
 | 
			
		|||
		}
 | 
			
		||||
 | 
			
		||||
		let mut relay_debug = String::new();
 | 
			
		||||
		let now = Local::now().time();
 | 
			
		||||
		for relay in this.relays.iter() {
 | 
			
		||||
			relay_debug.push_str(&format!(
 | 
			
		||||
				"{}: {} |",
 | 
			
		||||
				relay.r.name, relay.active_schedule.name
 | 
			
		||||
				"{}{}: {} ; ",
 | 
			
		||||
				if relay.active_schedule.is_on(&now) {
 | 
			
		||||
					"+"
 | 
			
		||||
				} else {
 | 
			
		||||
					"-"
 | 
			
		||||
				},
 | 
			
		||||
				relay.r.name,
 | 
			
		||||
				relay.active_schedule.name
 | 
			
		||||
			));
 | 
			
		||||
		}
 | 
			
		||||
		log::debug!(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue