fix allocated_draw for inactive PSU (#168)

Co-authored-by: Anton Grishyn <grishin@maxpay.com>
This commit is contained in:
Anton A. Grishin 2020-09-07 15:20:32 +03:00 committed by GitHub
parent fc930b9ef4
commit 28955612be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,6 +117,9 @@ class PowerSupply():
for i, nb_psu in enumerate(nb_psus):
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()
logging.info('Updated power consumption for PSU {}: {}W'.format(
nb_psu.name,