Add setting to change "midnight" of day
This commit is contained in:
parent
1e2afe481c
commit
4f48b04acc
6 changed files with 37 additions and 23 deletions
|
|
@ -6,7 +6,7 @@ use emgauwa_common::constants;
|
|||
use emgauwa_common::db::DbSchedule;
|
||||
use emgauwa_common::errors::EmgauwaError;
|
||||
use emgauwa_common::models::Controller;
|
||||
use emgauwa_common::types::{RelayStates, Weekday};
|
||||
use emgauwa_common::types::{EmgauwaNow, RelayStates};
|
||||
use futures::executor::block_on;
|
||||
use sqlx::{Pool, Sqlite};
|
||||
use tokio::sync::Notify;
|
||||
|
|
@ -36,7 +36,6 @@ pub struct RelayPulse {
|
|||
pub struct RelayOverrideSchedule {
|
||||
pub relay_number: i64,
|
||||
pub schedule: Option<DbSchedule>,
|
||||
pub weekday: Weekday,
|
||||
}
|
||||
|
||||
#[derive(Message)]
|
||||
|
|
@ -177,7 +176,7 @@ impl Handler<RelayOverrideSchedule> for AppState {
|
|||
fn handle(&mut self, msg: RelayOverrideSchedule, _ctx: &mut Self::Context) -> Self::Result {
|
||||
let relay_num = msg.relay_number;
|
||||
let schedule = msg.schedule;
|
||||
let weekday = msg.weekday;
|
||||
let weekday = EmgauwaNow::now(&self.settings.midnight).weekday;
|
||||
|
||||
let relay = self
|
||||
.this
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue