From fd934efaf107ace58e8c7f9376da006295692435 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Thu, 5 Dec 2024 14:32:24 -0800 Subject: [PATCH] Fix Shiny WebApp --- webapp/app.py | 14 +++--- webapp/color_and_brightness.py | 2 +- webapp/requirements.txt | 91 +--------------------------------- webapp/requirements.txt.in | 2 - 4 files changed, 8 insertions(+), 101 deletions(-) diff --git a/webapp/app.py b/webapp/app.py index ab896687..68dbb2f9 100644 --- a/webapp/app.py +++ b/webapp/app.py @@ -217,10 +217,9 @@ Dive into the simulator, experiment with different settings, and fine-tune the b # Shiny UI app_ui = ui.page_fluid( - shinyswatch.theme.sandstone(), ui.panel_title("🌞 Adaptive Lighting Simulator WebApp 🌛"), ui.layout_sidebar( - ui.panel_sidebar( + ui.sidebar( ui.input_switch("adapt_until_sleep", "adapt_until_sleep", value=False), ui.input_switch("sleep_mode", "sleep_mode", value=False), ui.input_slider("min_brightness", "min_brightness", 1, 100, 30, post="%"), @@ -277,13 +276,12 @@ app_ui = ui.page_fluid( post=" hr", ), ), - ui.panel_main( - ui.markdown(desc_top), - ui.output_plot(id="brightness_plot"), - ui.output_plot(id="color_temp_plot"), - ui.markdown(desc_bottom), - ), + ui.markdown(desc_top), + ui.output_plot(id="brightness_plot"), + ui.output_plot(id="color_temp_plot"), + ui.markdown(desc_bottom), ), + theme=shinyswatch.theme.sandstone, ) diff --git a/webapp/color_and_brightness.py b/webapp/color_and_brightness.py index 52386bf7..ba804df3 100644 --- a/webapp/color_and_brightness.py +++ b/webapp/color_and_brightness.py @@ -12,7 +12,7 @@ from datetime import timedelta from functools import cached_property, partial from typing import TYPE_CHECKING, Any, Literal, cast -from homeassistant.util.color import ( +from homeassistant_util_color import ( color_RGB_to_xy, color_temperature_to_rgb, color_xy_to_hs, diff --git a/webapp/requirements.txt b/webapp/requirements.txt index c91dc748..cbcadafc 100644 --- a/webapp/requirements.txt +++ b/webapp/requirements.txt @@ -1,95 +1,6 @@ # This file was autogenerated by uv via the following command: # uv pip compile --output-file=requirements.txt requirements.txt.in -anyio==4.7.0 - # via - # starlette - # watchfiles -appdirs==1.4.4 - # via - # shiny - # shinylive -asgiref==3.8.1 - # via shiny astral==2.2 # via -r requirements.txt.in -chevron==0.14.0 - # via shinylive -click==8.1.7 - # via - # shiny - # shinylive - # uvicorn -future==1.0.0 - # via lzstring -h11==0.14.0 - # via uvicorn -htmltools==0.6.0 - # via - # shiny - # shinyswatch -idna==3.10 - # via anyio -linkify-it-py==2.0.3 - # via shiny -lzstring==1.0.4 - # via shinylive -markdown-it-py==3.0.0 - # via - # mdit-py-plugins - # shiny -mdit-py-plugins==0.4.2 - # via shiny -mdurl==0.1.2 - # via markdown-it-py -narwhals==1.15.2 - # via shiny -orjson==3.10.12 - # via shiny -packaging==24.2 - # via - # htmltools - # shiny - # shinyswatch -prompt-toolkit==3.0.36 - # via - # questionary - # shiny -python-multipart==0.0.19 - # via shiny -pytz==2024.2 +pytz==2023.3.post1 # via astral -questionary==2.0.1 - # via shiny -setuptools==75.6.0 - # via - # shiny - # shinylive -shiny==1.2.1 - # via - # shinylive - # shinyswatch -shinylive==0.7.1 - # via -r requirements.txt.in -shinyswatch==0.8.0 - # via -r requirements.txt.in -sniffio==1.3.1 - # via anyio -starlette==0.41.3 - # via shiny -typing-extensions==4.12.2 - # via - # anyio - # htmltools - # shiny - # shinylive - # shinyswatch -uc-micro-py==1.0.3 - # via linkify-it-py -uvicorn==0.32.1 - # via shiny -watchfiles==1.0.0 - # via shiny -wcwidth==0.2.13 - # via prompt-toolkit -websockets==14.1 - # via shiny diff --git a/webapp/requirements.txt.in b/webapp/requirements.txt.in index f497a9b8..39c93a83 100644 --- a/webapp/requirements.txt.in +++ b/webapp/requirements.txt.in @@ -1,3 +1 @@ -shinylive==0.7.1 astral==2.2 -shinyswatch==0.8.0