diff --git a/.streamlit/config.toml b/.streamlit/config.toml index 19f4f89..f78c2d7 100644 --- a/.streamlit/config.toml +++ b/.streamlit/config.toml @@ -1,17 +1,18 @@ # .streamlit/config.toml - +# agile-home-dashboard [server] #headless = true # Run Streamlit in headless mode, ideal for cloud deployments port = 8501 # Define the port for the Streamlit app #enableCORS = false # Disable CORS if deploying within the same domain [theme] -base= "dark" -primaryColor = "#3d405b" -backgroundColor = "#f4f1de" -secondaryBackgroundColor = "#b8d6c7" -textColor = "#3d405b" +base= "light" +primaryColor = "#B5146A" # slider colour +backgroundColor = "#FCFCFC" +secondaryBackgroundColor = "#7DBDF5" # side bar +textColor = "#261132" font = "sans serif" + [browser] gatherUsageStats = false # Disable collection of usage statistics for privacy diff --git a/Home.py b/Home.py index d852bc0..90aff58 100644 --- a/Home.py +++ b/Home.py @@ -7,7 +7,7 @@ import streamlit as st import toml -from agile_home_dashboard import fetch_data +from agile_home_dashboard import fetch_data, load_css # Load the TOML file @@ -22,11 +22,17 @@ def load_config(file_path=".streamlit/config.toml"): initial_sidebar_state="expanded", ) +plotMarkerColor = "#7DBDF5" # plot marker colour + config = load_config() colors = config["theme"] -st.session_state.bg_color = colors["secondaryBackgroundColor"] +st.session_state.bg_color = colors["backgroundColor"] st.session_state.font = colors["textColor"] -st.session_state.marker = colors["textColor"] +st.session_state.marker = plotMarkerColor +st.session_state.textBoxColor = "#2A69A1" +st.session_state.textColor = "#B5146A" + +load_css() if "api_key" not in st.session_state: st.session_state.api_key = "" # Default value @@ -37,7 +43,7 @@ def load_config(file_path=".streamlit/config.toml"): api_key = st.session_state.api_key st.session_state.df = fetch_data(api_key) -day_to_plot = st.selectbox("Select a day to plot:", ["Today", "Tomorrow"]) +day_to_plot = st.radio("Select day:", options=["Today", "Tomorrow"], index=0) if day_to_plot == "Today": if st.session_state.df is None: st.write("No data available for today.") diff --git a/agile_home_dashboard.py b/agile_home_dashboard.py index 23a960a..bfc9dfa 100644 --- a/agile_home_dashboard.py +++ b/agile_home_dashboard.py @@ -108,3 +108,30 @@ def get_current_cost(df, current_time): next_price = next_cost_row["value_inc_vat"] return current_price, next_price, current_cost_row, next_cost_row + + +def load_css(): + st.markdown( + f""" + + """, + unsafe_allow_html=True, + ) diff --git a/pages/Kettle_Pricing.py b/pages/Kettle_Pricing.py index e47e19d..87758f0 100644 --- a/pages/Kettle_Pricing.py +++ b/pages/Kettle_Pricing.py @@ -2,7 +2,7 @@ import plotly.graph_objects as go import streamlit as st -from agile_home_dashboard import get_current_cost, get_current_time +from agile_home_dashboard import get_current_cost, get_current_time, load_css def calculate_kettle_cost(current_price, next_price, run_time, power): @@ -124,14 +124,17 @@ def plot_kettle_timing(): st.plotly_chart(fig) -# Main application logic +color = "#B87272" +load_css() + + def main(): st.title("Kettle Pricing on Octopus Agile") if st.session_state.df is not None: st.write("How much does the kettle cost right now?") run_time = st.number_input( - "Kettle run time [s]:", min_value=0, max_value=2000, value=137 + "Kettle run time [s]:", min_value=0, max_value=10000, value=137 ) power = st.number_input( "Kettle power [kW]:", min_value=0.0, max_value=1e8, value=2.1 diff --git a/pages/Oven_Pricing.py b/pages/Oven_Pricing.py index e57ae5b..dae45b8 100644 --- a/pages/Oven_Pricing.py +++ b/pages/Oven_Pricing.py @@ -1,6 +1,8 @@ import streamlit as st -from agile_home_dashboard import get_current_cost, get_current_time +from agile_home_dashboard import get_current_cost, get_current_time, load_css + +load_css() def main(): diff --git a/pages/Washing_Machine_Pricing.py b/pages/Washing_Machine_Pricing.py index 0b1bae7..e3c61c6 100644 --- a/pages/Washing_Machine_Pricing.py +++ b/pages/Washing_Machine_Pricing.py @@ -3,7 +3,9 @@ import pytz import streamlit as st -from agile_home_dashboard import get_current_time +from agile_home_dashboard import get_current_time, load_css + +load_css() def calculate_drying_cost(dry_time, power, df, current_time):