Skip to content

Commit

Permalink
Fix null data points in UPS stats
Browse files Browse the repository at this point in the history
  • Loading branch information
Qubad786 committed Sep 24, 2024
1 parent 4b65dc6 commit 42ef5f8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,19 @@ def get_chart_name(self, identifier: typing.Optional[str] = None) -> str:
class UPSBase(GraphBase):

UPS_IDENTIFIER = None
skip_zero_values_in_aggregation = True

async def export_multiple_identifiers(
self, query_params: dict, identifiers: list, aggregate: bool = True
) -> typing.List[dict]:
self.UPS_IDENTIFIER = (await self.middleware.call('ups.config'))['identifier']
return await super().export_multiple_identifiers(query_params, identifiers, aggregate)

def query_parameters(self) -> dict:
return super().query_parameters() | {
'group': 'median'
}


class UPSChargePlugin(UPSBase):

Expand Down Expand Up @@ -333,7 +339,6 @@ class UPSTemperaturePlugin(UPSBase):

title = 'UPS Temperature'
vertical_label = 'Celsius'
skip_zero_values_in_aggregation = True
uses_identifiers = False

def get_chart_name(self, identifier: typing.Optional[str]) -> str:
Expand Down

0 comments on commit 42ef5f8

Please sign in to comment.