Simplified device conversions and switched device list to hashmap to allow lookup by name

This commit is contained in:
2022-12-10 18:45:46 +01:00
parent 68cbccd72c
commit c9bbc35f74
3 changed files with 36 additions and 27 deletions

View File

@@ -23,14 +23,6 @@ impl Device for IkeaOutlet {
fn get_identifier(& self) -> &str {
&self.zigbee.get_friendly_name()
}
fn as_state_on_off(&mut self) -> Option<&mut dyn StateOnOff> {
Some(self)
}
fn as_listener(&mut self) -> Option<&mut dyn Listener> {
Some(self)
}
}
#[derive(Debug, Serialize, Deserialize)]