- Fork tapo crate to add missing schedule/timer APIs - Add get_countdown_rules, get_schedule_rules, get_next_event methods - New readings: countdown_active, countdown_remain, schedule_count, schedule_active_count, next_event_time - Add local compilation to build script alongside cross-compilation - Implement offline polling - device collection continues when server disconnects - Add more device readings: on_time, signal_level, rssi, runtime_today/month, energy_month Vendored tapo fork in tapo-fork/ with minimal changes to add schedule APIs.
24 lines
463 B
Rust
24 lines
463 B
Rust
use pyo3::PyErr;
|
|
use pyo3::exceptions::PyException;
|
|
use tapo::Error;
|
|
|
|
pub struct ErrorWrapper(pub Error);
|
|
|
|
impl From<Error> for ErrorWrapper {
|
|
fn from(err: Error) -> Self {
|
|
Self(err)
|
|
}
|
|
}
|
|
|
|
impl From<anyhow::Error> for ErrorWrapper {
|
|
fn from(err: anyhow::Error) -> Self {
|
|
Self(err.into())
|
|
}
|
|
}
|
|
|
|
impl From<ErrorWrapper> for PyErr {
|
|
fn from(err: ErrorWrapper) -> PyErr {
|
|
PyException::new_err(format!("{:?}", err.0))
|
|
}
|
|
}
|