fix allocated_draw for inactive PSU (#168)
Co-authored-by: Anton Grishyn <grishin@maxpay.com>
This commit is contained in:
parent
fc930b9ef4
commit
28955612be
1 changed files with 3 additions and 0 deletions
|
@ -117,6 +117,9 @@ class PowerSupply():
|
||||||
|
|
||||||
for i, nb_psu in enumerate(nb_psus):
|
for i, nb_psu in enumerate(nb_psus):
|
||||||
nb_psu.allocated_draw = float(psu_cons[i]) * voltage
|
nb_psu.allocated_draw = float(psu_cons[i]) * voltage
|
||||||
|
if nb_psu.allocated_draw < 1:
|
||||||
|
logging.info('PSU is not connected or in standby mode')
|
||||||
|
continue
|
||||||
nb_psu.save()
|
nb_psu.save()
|
||||||
logging.info('Updated power consumption for PSU {}: {}W'.format(
|
logging.info('Updated power consumption for PSU {}: {}W'.format(
|
||||||
nb_psu.name,
|
nb_psu.name,
|
||||||
|
|
Loading…
Reference in a new issue