mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Fixes #3126: Incorrect calculation of PowerFeed available power
This commit is contained in:
parent
088903218d
commit
cb93303f56
@ -4,6 +4,7 @@ v2.6.0 (FUTURE)
|
|||||||
|
|
||||||
* [#3123](https://github.com/digitalocean/netbox/issues/3123) - Exempt `/metrics` view from authentication
|
* [#3123](https://github.com/digitalocean/netbox/issues/3123) - Exempt `/metrics` view from authentication
|
||||||
* [#3125](https://github.com/digitalocean/netbox/issues/3125) - Fix exception when viewing PDUs
|
* [#3125](https://github.com/digitalocean/netbox/issues/3125) - Fix exception when viewing PDUs
|
||||||
|
* [#3126](https://github.com/digitalocean/netbox/issues/3126) - Incorrect calculation of PowerFeed available power
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -1973,7 +1973,7 @@ class PowerPort(CableTermination, ComponentModel):
|
|||||||
)
|
)
|
||||||
utilization['name'] = 'Leg {}'.format(leg_name)
|
utilization['name'] = 'Leg {}'.format(leg_name)
|
||||||
utilization['outlets'] = len(outlet_ids)
|
utilization['outlets'] = len(outlet_ids)
|
||||||
utilization['available_power'] = powerfeed_available / 3
|
utilization['available_power'] = round(powerfeed_available / 3)
|
||||||
stats.append(utilization)
|
stats.append(utilization)
|
||||||
|
|
||||||
return stats
|
return stats
|
||||||
@ -2998,7 +2998,7 @@ class PowerFeed(ChangeLoggedModel, CableTermination, CustomFieldModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def available_power(self):
|
def available_power(self):
|
||||||
kva = self.voltage * self.amperage * self.power_factor
|
kva = self.voltage * self.amperage * (self.power_factor / 100)
|
||||||
if self.phase == POWERFEED_PHASE_3PHASE:
|
if self.phase == POWERFEED_PHASE_3PHASE:
|
||||||
return kva * 1.732
|
return round(kva * 1.732)
|
||||||
return kva
|
return round(kva)
|
||||||
|
Loading…
Reference in New Issue
Block a user