Skip to content

PropRef ​

Generated

This page is generated by docs/site/scripts/gen-api.mjs from firmware/src/ui/Ui.h; descriptions and examples live in docs/site/scripts/api-notes.json.

Runtime prop updates without a rebuild: ui.prop("temp").label("Boiler temp").color("#f00"); collects the changes and sends one prop message to all clients when the temporary PropRef goes out of scope (end of the statement). The firmware keeps mutable props so a later ui resend is consistent.

Props ​

label ​

cpp
PropRef& label(const char* v)

New label.

cpp
ui.prop("temp").label("Temp (HOT)");

color ​

cpp
PropRef& color(const char* v)

New accent color.

cpp
ui.prop("temp").color("#ff0000");

hint ​

cpp
PropRef& hint(const char* v)

New hint text.

cpp
ui.prop("reset").hint("Press to clear");

icon ​

cpp
PropRef& icon(const char* v)

New icon.

cpp
ui.prop("pump").icon("water_drop");

unit ​

cpp
PropRef& unit(const char* v)

New unit.

cpp
ui.prop("temp").unit("°F");

src ​

cpp
PropRef& src(const char* v)

New image / stream URL.

cpp
ui.prop("img").src("http://192.168.1.60/latest.jpg");

text ​

cpp
PropRef& text(const char* v)

New paragraph for a textblock.

cpp
ui.prop("help").text("Pump disabled while heating.");

min ​

cpp
PropRef& min(float v)

New minimum.

cpp
ui.prop("target").min(10);

max ​

cpp
PropRef& max(float v)

New maximum.

cpp
ui.prop("target").max(150);

step ​

cpp
PropRef& step(float v)

New step.

cpp
ui.prop("target").step(5);

options ​

cpp
PropRef& options(const std::vector<const char*>& opts)

Replaces the options of a select / flags widget.

cpp
ui.prop("mode").options({"Off", "Eco", "Boost"});

Visibility ​

disabled ​

cpp
PropRef& disabled(bool v)

Enable/disable the widget.

cpp
ui.prop("pump").disabled(true);

visible ​

cpp
PropRef& visible(bool v)

Show/hide the widget (same as ui.show()).

cpp
ui.prop("reset").visible(false);

Generic ​

str ​

cpp
PropRef& str(PKey k, const char* v)

Any string prop by key.

cpp
ui.prop("x").str(PKey::style, "seg");

num ​

cpp
PropRef& num(PKey k, float v)

Any numeric prop by key.

cpp
ui.prop("c").num(PKey::win, 120);

boolean ​

cpp
PropRef& boolean(PKey k, bool v)

Any boolean prop by key.

cpp
ui.prop("c").boolean(PKey::legend, false);

MIT licensed. Firmware, web renderer and apps.