akshayballal commited on
Commit
f28f1ba
1 Parent(s): d54fb28

chore: Update energy usage statistics display in dashboard.py

Browse files
Files changed (1) hide show
  1. dashboard.py +6 -6
dashboard.py CHANGED
@@ -376,9 +376,9 @@ with st.container():
376
  with row2_row2_col2:
377
  energy_stats_placeholder = {"box": st.empty(), "sub": st.empty()}
378
 
379
- energy_stats_placeholder["box"].title("Energy Usage Statistics")
380
  energy_stats_placeholder["sub"].text(
381
- f"Average: {max_energy} kWh\nHighest: {average_energy} kWh"
382
  ) # ---- REPLACE WITH ACTUAL DATA ----
383
 
384
 
@@ -462,8 +462,8 @@ while True:
462
  fault_4 = None
463
 
464
  energy = (
465
- pd.DataFrame(mqtt_client.data_list)["hvac_N"].item()
466
- + pd.DataFrame(mqtt_client.data_list)["hvac_N"].item()
467
  )
468
  k += 1
469
 
@@ -473,7 +473,7 @@ while True:
473
  max_energy = energy
474
 
475
  energy_stats_placeholder["sub"].text(
476
- f"Average: {max_energy} kWh\nHighest: {average_energy} kWh"
477
  ) # ---- REPLACE WITH ACTUAL DATA ----
478
 
479
  df_new1, df_trans1, df_new2, df_trans2 = rtu_data_pipeline.fit(
@@ -670,7 +670,7 @@ while True:
670
  fig = px.line(
671
  x=x_time,
672
  y=energy_prediction_north,
673
- labels={"x": "Time", "y": "Energy (kWh)"},
674
  height=200,
675
  )
676
 
 
376
  with row2_row2_col2:
377
  energy_stats_placeholder = {"box": st.empty(), "sub": st.empty()}
378
 
379
+ energy_stats_placeholder["box"].subheader("Energy Usage Statistics")
380
  energy_stats_placeholder["sub"].text(
381
+ f"Average: {int(average_energy)} kW\nHighest: {int(max_energy)} kW"
382
  ) # ---- REPLACE WITH ACTUAL DATA ----
383
 
384
 
 
462
  fault_4 = None
463
 
464
  energy = (
465
+ pd.DataFrame(mqtt_client.data_list)["hvac_N"][0].item()
466
+ + pd.DataFrame(mqtt_client.data_list)["hvac_S"][0].item()
467
  )
468
  k += 1
469
 
 
473
  max_energy = energy
474
 
475
  energy_stats_placeholder["sub"].text(
476
+ f"Average: {int(average_energy)} kW\nHighest: {int(max_energy)} kW"
477
  ) # ---- REPLACE WITH ACTUAL DATA ----
478
 
479
  df_new1, df_trans1, df_new2, df_trans2 = rtu_data_pipeline.fit(
 
670
  fig = px.line(
671
  x=x_time,
672
  y=energy_prediction_north,
673
+ labels={"x": "Time", "y": "Energy (kW)"},
674
  height=200,
675
  )
676