Compare commits
3 Commits
53a2fc2a35
...
41cf9d0d09
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41cf9d0d09 | ||
|
|
d6418b5fb0 | ||
|
|
c0737c4420 |
@@ -1,6 +1,6 @@
|
|||||||
use crate::messages::{
|
use crate::messages::{
|
||||||
GetSysInfo, GetSysInfoResponse, LB130USSys, LightState, Off, On, SetLightLastOn, SetLightOff,
|
GetSysInfo, GetSysInfoResponse, LB130USSys, SetLightState, SetLightStateArgs,
|
||||||
SetLightState, SetLightStateArgs, SetLightStateResponse, SetLightTo, SysInfo,
|
SetLightStateResponse, SysInfo,
|
||||||
};
|
};
|
||||||
use backon::{FibonacciBuilder, Retryable};
|
use backon::{FibonacciBuilder, Retryable};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
use std::convert::Infallible;
|
|
||||||
|
|
||||||
use palette::{encoding::Srgb, Hsv, IntoColor};
|
use palette::{encoding::Srgb, Hsv, IntoColor};
|
||||||
use protocol::light::{GetState, SetState, TurnToColor, TurnToTemperature};
|
use protocol::light::{GetState, SetState, TurnToColor, TurnToTemperature};
|
||||||
use snafu::{ResultExt, Snafu};
|
use snafu::{ResultExt, Snafu};
|
||||||
@@ -7,8 +5,8 @@ use snafu::{ResultExt, Snafu};
|
|||||||
use crate::{
|
use crate::{
|
||||||
connection::{HandleError, LB130USHandle},
|
connection::{HandleError, LB130USHandle},
|
||||||
messages::{
|
messages::{
|
||||||
Angle, Hsb, LightState, Off, On, Percentage, SetLightHsv, SetLightKelvin, SetLightLastOn,
|
LightState, Off, On, SetLightHsv, SetLightKelvin, SetLightLastOn, SetLightOff,
|
||||||
SetLightOff, SetLightStateArgs, SetLightTo,
|
SetLightStateArgs, SetLightTo,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,16 @@
|
|||||||
use std::{num::NonZeroUsize, path::PathBuf, str::FromStr, time::Duration};
|
use std::{path::PathBuf, str::FromStr, time::Duration};
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use driver_kasa::connection::LB130USHandle;
|
use driver_kasa::connection::LB130USHandle;
|
||||||
use futures::stream::{FuturesUnordered, StreamExt};
|
use futures::stream::{FuturesUnordered, StreamExt};
|
||||||
use home_assistant::{
|
use home_assistant::{home_assistant::HomeAssistant, object_id::ObjectId};
|
||||||
event::context::context::Context, home_assistant::HomeAssistant, light::HomeAssistantLight,
|
use protocol::light::{Kelvin, TurnToTemperature};
|
||||||
notify::service::mobile_app::StandardNotification, object_id::ObjectId,
|
|
||||||
};
|
|
||||||
use persisted::{persisted, Config, Keyspace, Partition, PartitionCreateOptions};
|
|
||||||
use protocol::light::{IsOff, IsOn, Kelvin, TurnToTemperature};
|
|
||||||
use pyo3::prelude::*;
|
use pyo3::prelude::*;
|
||||||
use shadow_rs::shadow;
|
use shadow_rs::shadow;
|
||||||
use tokio::{
|
use tokio::time::{interval, MissedTickBehavior};
|
||||||
task::{spawn_blocking, JoinSet},
|
|
||||||
time::{interval, MissedTickBehavior},
|
|
||||||
};
|
|
||||||
use tracing::{level_filters::LevelFilter, Level};
|
use tracing::{level_filters::LevelFilter, Level};
|
||||||
use tracing_appender::rolling::{self, RollingFileAppender};
|
|
||||||
use tracing_subscriber::{
|
use tracing_subscriber::{
|
||||||
fmt::{self, fmt, format::FmtSpan},
|
fmt::{self, format::FmtSpan},
|
||||||
layer::SubscriberExt,
|
layer::SubscriberExt,
|
||||||
registry,
|
registry,
|
||||||
util::SubscriberInitExt,
|
util::SubscriberInitExt,
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
use std::fmt::Display;
|
|
||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use pyo3::FromPyObject;
|
use pyo3::FromPyObject;
|
||||||
use python_utils::{FromPyFromStr, ToStrToPy};
|
use python_utils::{FromPyFromStr, ToStrToPy};
|
||||||
use snafu::Snafu;
|
|
||||||
use string_literal::StringLiteral;
|
use string_literal::StringLiteral;
|
||||||
|
|
||||||
use crate::{entity_id::EntityId, state_object::StateObject};
|
use crate::{entity_id::EntityId, state_object::StateObject};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::{convert::Infallible, str::FromStr};
|
use std::str::FromStr;
|
||||||
|
|
||||||
use pyo3::{
|
use pyo3::{
|
||||||
types::{PyDict, PyDictMethods, PyString},
|
types::{PyDict, PyDictMethods},
|
||||||
Bound, IntoPyObject, PyErr, Python,
|
Bound, IntoPyObject, PyErr, Python,
|
||||||
};
|
};
|
||||||
use python_utils::{FromPyFromStr, IntoPyObjectViaDisplay, ToStrToPy};
|
use python_utils::{FromPyFromStr, IntoPyObjectViaDisplay, ToStrToPy};
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use python_utils::{FromPyFromStr, ToStrToPy};
|
use python_utils::{FromPyFromStr, ToStrToPy};
|
||||||
use strum::EnumString;
|
use strum::EnumString;
|
||||||
use uom::{
|
use uom::{
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ impl ToTokens for StringLiteral {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
dbg!(&output.to_string());
|
|
||||||
|
|
||||||
tokens.extend(output);
|
tokens.extend(output);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user