From 84d21a02df93b4b4304bdc9aab2766cac1ae9d58 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Sat, 9 Dec 2023 14:29:17 +0100 Subject: [PATCH] Fix order of magnitude for pv_port{1,2}_energy (#63) --- hms2mqtt/src/simple_mqtt.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hms2mqtt/src/simple_mqtt.rs b/hms2mqtt/src/simple_mqtt.rs index 9811f308..20f74ca5 100644 --- a/hms2mqtt/src/simple_mqtt.rs +++ b/hms2mqtt/src/simple_mqtt.rs @@ -37,12 +37,12 @@ impl MetricCollector for SimpleMqtt { let pv_port1_voltage = hms_state.port_state[0].pv_vol as f32 / 10.; let pv_port1_curr = hms_state.port_state[0].pv_cur as f32 / 100.; let pv_port1_power = hms_state.port_state[0].pv_power as f32 / 10.; - let pv_port1_energy = hms_state.port_state[0].pv_energy_total as f32 / 10.; + let pv_port1_energy = hms_state.port_state[0].pv_energy_total as f32; let pv_port1_daily_yield = hms_state.port_state[0].pv_daily_yield as f32 / 10.; let pv_port2_voltage = hms_state.port_state[1].pv_vol as f32 / 10.; let pv_port2_curr = hms_state.port_state[1].pv_cur as f32 / 100.; let pv_port2_power = hms_state.port_state[1].pv_power as f32 / 10.; - let pv_port2_energy = hms_state.port_state[1].pv_energy_total as f32 / 10.; + let pv_port2_energy = hms_state.port_state[1].pv_energy_total as f32; let pv_port2_daily_yield = hms_state.port_state[1].pv_daily_yield as f32 / 10.; // TODO: this section bears a lot of repetition. Investigate if there's a more idiomatic way to get the same result, perhaps using a macro