Better handle enabled / disabled relays

This commit is contained in:
2024-09-15 22:01:06 +02:00
parent 2262b98952
commit 9c45e541dd
2 changed files with 10 additions and 11 deletions

View File

@ -140,7 +140,7 @@ impl EnergyEngine {
// Forcefully turn off disabled relays
for d in devices {
for r in &d.relays {
if !r.enabled {
if !r.enabled || !d.enabled {
new_relays_state.get_mut(&r.id).unwrap().on = false;
}
}