Display relays status
This commit is contained in:
central_backend/src
central_frontend/src
@ -39,6 +39,10 @@ impl RelayState {
|
||||
fn is_off(&self) -> bool {
|
||||
!self.on
|
||||
}
|
||||
|
||||
pub fn state_for(&self) -> usize {
|
||||
(time_secs() - self.since as u64) as usize
|
||||
}
|
||||
}
|
||||
|
||||
type RelaysState = HashMap<DeviceRelayID, RelayState>;
|
||||
|
Reference in New Issue
Block a user