Skip to content

Commit

Permalink
Adding oil boiler power
Browse files Browse the repository at this point in the history
  • Loading branch information
thdfw committed Jan 6, 2025
1 parent 575415f commit 01f6593
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions visualizer_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ def get_data(request):
aa_modes['all']['values'].append(aa_modes_order.index(state))
aa_modes[state]['times'].append(time)
aa_modes[state]['values'].append(aa_modes_order.index(state))
print(aa_modes.keys())

if "Dormant" in top_modes:
top_modes['Admin'] = top_modes['Dormant']
Expand Down Expand Up @@ -603,6 +602,7 @@ async def get_csv(request: CsvRequest, apirequest: Request):
"reload": False
}


# ------------------------------
# Download Dijkstra Excel
# ------------------------------
Expand Down Expand Up @@ -632,7 +632,6 @@ async def get_excel(request: DijkstraRequest):
async def get_plots(request: Union[DataRequest, DijkstraRequest], apirequest: Request):

if isinstance(request, DijkstraRequest):
print("made it here")

download_excel(request.house_alias, request.time_ms)

Expand Down Expand Up @@ -750,6 +749,19 @@ async def get_plots(request: Union[DataRequest, DijkstraRequest], apirequest: Re
yaxis=y_axis_power
)
)
if 'oil-boiler-pwr' in request.selected_channels and 'oil-boiler-pwr' in channels:
power_plot = True
fig.add_trace(
go.Scatter(
x=channels['oil-boiler-pwr']['times'],
y=[x/100 for x in channels['oil-boiler-pwr']['values']],
mode=line_style,
opacity=0.7,
line=dict(color=home_alone_line, dash='solid'),
name='Oil boiler power x10',
yaxis=y_axis_power
)
)
if time.time() - request_start > TIMEOUT_SECONDS:
raise asyncio.TimeoutError('Timed out')
if await apirequest.is_disconnected():
Expand Down

0 comments on commit 01f6593

Please sign in to comment.