Architectural changes and added first basic implementation for handling queries (does not handle errors)

This commit is contained in:
2022-12-15 05:04:04 +01:00
parent 4de0b31ec8
commit 995ff08784
10 changed files with 154 additions and 57 deletions

View File

@@ -31,7 +31,7 @@ pub trait AsOnOff {
None
}
}
impl<T: GoogleHomeDevice + OnOff> AsOnOff for T {
impl<'a, T: GoogleHomeDevice<'a> + OnOff> AsOnOff for T {
fn cast(&self) -> Option<&dyn OnOff> {
Some(self)
}
@@ -56,7 +56,7 @@ pub trait AsScene {
None
}
}
impl<T: GoogleHomeDevice + Scene> AsScene for T {
impl<'a, T: GoogleHomeDevice<'a> + Scene> AsScene for T {
fn cast(&self) -> Option<&dyn Scene> {
Some(self)
}