From 4273640cd32b806da488f4ceef42525ef2f2dc47 Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Sun, 2 Oct 2022 22:23:37 +0200 Subject: [PATCH] Add SetBulbWakeTime client message --- Cargo.lock | 1 + common/Cargo.toml | 1 + common/src/lib.rs | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b125145..aee80cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -173,6 +173,7 @@ dependencies = [ name = "common" version = "0.1.0" dependencies = [ + "chrono", "lighter_lib", "serde", ] diff --git a/common/Cargo.toml b/common/Cargo.toml index 57b538b..72165cb 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" [dependencies] serde = { version = "1.0.137", features = ["derive"] } +chrono = { version = "0.4.20", features = ["serde"] } [dependencies.lighter_lib] git = "https://git.nubo.sh/hulthe/lighter.git" diff --git a/common/src/lib.rs b/common/src/lib.rs index e1714ce..0916a7d 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -1,3 +1,4 @@ +use chrono::{NaiveTime, Weekday}; use lighter_lib::{BulbColor, BulbId, BulbMode}; use serde::{Deserialize, Serialize}; @@ -23,8 +24,19 @@ pub enum ClientMessage { //SubscribeToInfo, //SubscribeToBulbs, GetBulbs, - SetBulbColor { id: BulbId, color: BulbColor }, - SetBulbPower { id: BulbId, power: bool }, + SetBulbColor { + id: BulbId, + color: BulbColor, + }, + SetBulbPower { + id: BulbId, + power: bool, + }, + SetBulbWakeTime { + id: BulbId, + day: Weekday, + time: NaiveTime, + }, } /// A geometric description of rooms/groups of light bulbs