1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use tokio::runtime::Runtime;
use crate::brain::{Brain, BrainFailure};
use crate::io::IOBundle;
use crate::time_util::mytime::TimeProvider;

pub struct Dummy {
}

impl Brain for Dummy {
    fn run(&mut self, _runtime: &Runtime, io_bundle: &mut IOBundle, _time: &impl TimeProvider) -> Result<(), BrainFailure> {
        println!("Hello from brain");
        println!("Is heating on: {:?}", futures::executor::block_on(io_bundle.wiser().get_heating_on()));
        if let Some(off_time) = futures::executor::block_on(io_bundle.wiser().get_heating_turn_off_time()) {
            println!("Heating off time: {:?}", off_time);
        }
        Ok(())
    }

    fn reload_config(&mut self) {}
}