Direct controls on wide cards, weather/climate cards, spinner busy state (0.2.23)
App 0.2.23 / firmware 0.2.19. - Wide cards of climate, switch, light, fan, vacuum, cover, media_player, number, select, timer, scene, script and button show Home Assistant style controls on the right (keys, -/+ pill with debounced send, slider with handle, toggle, run key); per-tile choice `options.controls` in the editor with mockup preview; the add-on sends only the set a card really shows. - Weather card: now + next hours and coming days with rain, from daily and hourly forecasts; scenes/scripts/buttons show when they last ran. - Climate card: power key, tap-to-toggle option, fan and swing rows in a redesigned mode picker (grey backdrop, white chips, accent selection). - Busy state as a spinner on a translucent sheet; render guards so only changed styles reach LVGL; dark theme removed from the runtime code. - supported_features above 1e6 reaches the screen; middle dot in text fonts; 18 control glyphs in the icon fonts; diagnostics services preview_climate_picker and preview_busy; demo layout --controls. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,20 @@
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
namespace cyd {
|
||||
// The n-th quoted item of a JSON list such as ["auto","low","high"]; empty when absent.
|
||||
inline std::string list_item(const std::string &json, unsigned index) {
|
||||
size_t pos = 0; unsigned n = 0;
|
||||
while ((pos = json.find('"', pos)) != std::string::npos) {
|
||||
size_t end = json.find('"', pos + 1);
|
||||
if (end == std::string::npos) return {};
|
||||
if (n++ == index) return json.substr(pos + 1, end - pos - 1);
|
||||
pos = end + 1;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
// Work in tenths of a degree and always clamp AFTER rounding.
|
||||
inline int quantize_temperature(int value, int minimum, int maximum, int step) {
|
||||
step = std::max(1, step);
|
||||
|
||||
Reference in New Issue
Block a user