Fix no-power issue for machines

This commit is contained in:
Joachim Stolberg 2021-05-21 17:14:34 +02:00
parent dd7636744a
commit bb98cce44e

View File

@ -155,11 +155,14 @@ end
-- consumes power -- consumes power
function techage.needs_power(nvm) function techage.needs_power(nvm)
local state = nvm.techage_state or STOPPED local state = nvm.techage_state or STOPPED
return state == RUNNING or state == NOPOWER -- "blocked" must need power, otherwise it could happen, that the node
-- is not in the power network anymore and gets not started if
-- power is turned off and on again.
return state < STANDBY or state == NOPOWER
end end
function techage.needs_power2(state) function techage.needs_power2(state)
return state == RUNNING or state == NOPOWER return state < STANDBY or state == NOPOWER
end end
function techage.get_state_string(nvm) function techage.get_state_string(nvm)