Files
2026-10-12 20:49:13 +02:00

53 lines
3.7 KiB
Python

"""Named, normalized presentation data for the v0 showcase."""
def metric(icon, label, value, unit="", detail="", tone="neutral", trend=""):
return dict(icon=icon, label=label, value=value, unit=unit, detail=detail, tone=tone, trend=trend)
HEALTH = [
metric("bi-person-walking", "Steps", "8,426", detail="↑ 12% versus 7-day average", tone="good", trend="up"),
metric("bi-moon-stars", "Sleep", "7 h 42", detail="A restful night", tone="good"),
metric("bi-fire", "Active energy", "428", "kcal", "Goal: 500 kcal"),
metric("bi-activity", "Exercise", "47", "min", "↑ 9 min versus average", "good", "up"),
metric("bi-heart-pulse", "Resting heart rate", "58", "bpm", "Within your usual range", "good"),
]
ENERGY = [
metric("bi-currency-euro", "Electricity price", "€0.19", "/kWh", "Cheap until 11:00", "good"),
metric("bi-lightning-charge", "Power now", "486", "W", "↓ 18% versus usual", "good", "down"),
metric("bi-bar-chart", "Consumed today", "12.4", "kWh", "Through 19:00"),
metric("bi-receipt", "Estimated cost", "€3.84", detail="Today so far"),
metric("bi-graph-down", "Average purchase", "€0.23", "/kWh", "Today"),
metric("bi-percent", "During cheap hours", "61", "%", "Of today's consumption", "good"),
]
HOME_SENSORS = [
metric("bi-thermometer-half", "Temperature", "20.8", "°C", "Living room · comfortable", "good"),
metric("bi-droplet", "Humidity", "46", "%", "Living room · normal", "good"),
metric("bi-wind", "CO₂", "612", "ppm", "Bedroom · good air", "good"),
metric("bi-plug", "Household power", "486", "W", "Live demo reading"),
metric("bi-battery-half", "Door sensor", "72", "%", "Battery · normal", "good"),
]
ROOMS = [
dict(name="Living room", icon="bi-house-heart", temperature="20.8 °C", detail="46% humidity", state="3 devices on", tone="good"),
dict(name="Bedroom", icon="bi-moon", temperature="18.9 °C", detail="52% humidity", state="All lights off", tone="neutral"),
dict(name="Balcony", icon="bi-sun", temperature="12.4 °C", detail="Outdoor", state="Lights on", tone="neutral"),
]
TIMELINE = [
dict(time="08:14", icon="bi-moon-stars", title="Woke up", source="Health"),
dict(time="08:31", icon="bi-lightning-charge", title="Household power increased to 620 W", source="Energy"),
dict(time="09:02", icon="bi-currency-euro", title="Electricity entered cheap-price window", source="Energy"),
dict(time="09:18", icon="bi-person-walking", title="Reached 1,000 steps", source="Health"),
dict(time="10:04", icon="bi-plug", title="Washing machine started", source="Home"),
dict(time="12:36", icon="bi-activity", title="Workout · 42 min", source="Health"),
]
TODAY_GROUPS = [
dict(name="Health", icon="bi-heart", href="health", summary="A good start to the day", metrics=HEALTH[:2] + [HEALTH[3]]),
dict(name="Energy", icon="bi-lightning-charge", href="energy", summary="Cheap electricity until 11:00", metrics=ENERGY[:2] + [ENERGY[3]]),
dict(name="Home", icon="bi-house", href="home", summary="Comfortable throughout the house", metrics=[HOME_SENSORS[0], HOME_SENSORS[1], metric("bi-lightbulb", "Balcony lights", "On", detail="Demo state")]),
]
ACTIVITY_CHART = {"labels": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], "activity": [36, 51, 42, 68, 47, 72, 47], "baseline": [45] * 7}
TREND_CHART = {"labels": ["Thu", "Fri", "Sat", "Sun", "Mon", "Tue", "Wed"], "activity": [7100, 9200, 8300, 10400, 6300, 7600, 8426], "baseline": [7800] * 7}
ENERGY_CHART = {
"labels": [f"{hour:02d}:00" for hour in range(24)],
"price": [.27,.25,.23,.21,.20,.18,.17,.18,.19,.19,.18,.20,.23,.24,.27,.31,.35,.38,.41,.37,.33,.29,.26,.24],
"consumption": [.27,.23,.22,.21,.24,.32,.52,.78,.61,.49,.42,.67,.72,.58,.53,.6,.9,1.32,1.7,1.12,.76,.6,.43,.32],
}