Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions custom_components/ocpp/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,7 @@ def process_phases(self, data):
+ value[Phase.l2_n.value]
+ value[Phase.l3_n.value]
)
if sum > 0:
self._metrics[metric] = round(sum / 3, 1)
else:
self._metrics[metric] = round(sum, 1)
self._metrics[metric] = round(sum / 3, 1)
if metric in [
Measurand.current_import.value,
Measurand.current_export.value,
Expand Down Expand Up @@ -746,7 +743,7 @@ def on_meter_values(self, connector_id: int, meter_value: Dict, **kwargs):
self._metrics[DEFAULT_MEASURAND] = float(sv[om.value.value]) / 1000
self._units[DEFAULT_MEASURAND] = HA_ENERGY_UNIT
processed_keys.append(idx)
self._extra_attr[om.location.value] = sv.get(om.location.value)
self._extra_attr[sv[om.location.value]] = sv.get(om.location.value)
for idx in sorted(processed_keys, reverse=True):
unprocessed.pop(idx)
# _LOGGER.debug("Meter data not yet processed: %s", unprocessed)
Expand Down