next iteration on display, still some artifacting issues, and ux with buttons states and updating
This commit is contained in:
1 parent
45998b6176
commit
ae5d12b3a2
14 files changed
+860
-398
No files matched your search
@@ -233,6 +233,24 @@ static void apply_mock_data(void)
|
||||
sim_data.lights[0].brightness = 178; /* 70% */
|
||||
sim_data.lights[4].state = HA_LIGHT_UNAVAILABLE;
|
||||
|
||||
/*
|
||||
* Synthetic trend history: an "hour-old" anchor per channel so the
|
||||
* arrows render in the mock. Unsigned tick arithmetic makes now-55min
|
||||
* safe even seconds after boot. Snapshot mode gets no history and shows
|
||||
* no arrows -- which is exactly what a freshly booted device does.
|
||||
*/
|
||||
const uint32_t now = lv_tick_get();
|
||||
const uint32_t hour_ago = now - 55u * 60u * 1000u;
|
||||
ha_trend_feed(HA_TREND_CH_INDOOR, 77.1f, hour_ago); /* -> rising */
|
||||
ha_trend_feed(HA_TREND_CH_INDOOR, 78.1f, now);
|
||||
ha_trend_feed(HA_TREND_CH_OUTDOOR, 74.6f, hour_ago); /* -> falling */
|
||||
ha_trend_feed(HA_TREND_CH_OUTDOOR, 73.0f, now);
|
||||
ha_trend_feed(HA_TREND_CH_PRESSURE, 29.95f, hour_ago); /* -> falling */
|
||||
ha_trend_feed(HA_TREND_CH_PRESSURE, 29.89f, now);
|
||||
sim_data.trend_indoor = ha_trend_compute(HA_TREND_CH_INDOOR, 0.5f, now);
|
||||
sim_data.trend_outdoor = ha_trend_compute(HA_TREND_CH_OUTDOOR, 0.5f, now);
|
||||
sim_data.trend_pressure = ha_trend_compute(HA_TREND_CH_PRESSURE, 0.02f, now);
|
||||
|
||||
static const char *const days[HA_FORECAST_DAYS] = { "Tue", "Wed", "Thu", "Fri", "Sat" };
|
||||
static const char *const cond[HA_FORECAST_DAYS] = {
|
||||
"partlycloudy", "sunny", "sunny", "clear-night", "rainy"
|
||||
|
||||
Reference in new issue
Block a user