Color overview gauges by active filament and show finish times.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Joshua King
2026-10-20 19:22:04 -04:00
co-authored by Cursor
parent 360e86e46a
commit c5b7408b18
7 changed files with 380 additions and 235 deletions
+305 -190
View File
@@ -1490,7 +1490,6 @@ script:
- id: fleet_refresh
then:
- lambda: !lambda |-
bambu_display::FleetCounts counts;
{
bambu_display::Snapshot data;
data.connected = id(ha_api).is_connected_with_state_subscription();
@@ -1532,8 +1531,7 @@ script:
data.trays.push_back({"B2", id(prints_charming_tray_5_type).state, id(prints_charming_tray_5_color).state, id(prints_charming_tray_5_active).state});
data.trays.push_back({"B3", id(prints_charming_tray_6_type).state, id(prints_charming_tray_6_color).state, id(prints_charming_tray_6_active).state});
data.trays.push_back({"B4", id(prints_charming_tray_7_type).state, id(prints_charming_tray_7_color).state, id(prints_charming_tray_7_active).state});
bambu_display::tally(counts, data);
bambu_display::render_overview(data, {id(prints_charming_overview_arc), id(prints_charming_overview_value), id(prints_charming_overview_detail)});
bambu_display::render_overview(data, {id(prints_charming_overview_arc), id(prints_charming_overview_value), id(prints_charming_overview_finish)});
}
{
bambu_display::Snapshot data;
@@ -1567,8 +1565,7 @@ script:
if (clock.is_valid() && seconds_left >= 0)
data.finish_time = esphome::ESPTime::from_epoch_local(clock.timestamp + seconds_left).strftime("%H:%M");
data.trays.push_back({"EXT", id(polly_pocket_tray_0_type).state, id(polly_pocket_tray_0_color).state, id(polly_pocket_tray_0_active).state});
bambu_display::tally(counts, data);
bambu_display::render_overview(data, {id(polly_pocket_overview_arc), id(polly_pocket_overview_value), id(polly_pocket_overview_detail)});
bambu_display::render_overview(data, {id(polly_pocket_overview_arc), id(polly_pocket_overview_value), id(polly_pocket_overview_finish)});
}
{
bambu_display::Snapshot data;
@@ -1605,8 +1602,7 @@ script:
data.trays.push_back({"A2", id(ds_turd_flinger_tray_1_type).state, id(ds_turd_flinger_tray_1_color).state, id(ds_turd_flinger_tray_1_active).state});
data.trays.push_back({"A3", id(ds_turd_flinger_tray_2_type).state, id(ds_turd_flinger_tray_2_color).state, id(ds_turd_flinger_tray_2_active).state});
data.trays.push_back({"A4", id(ds_turd_flinger_tray_3_type).state, id(ds_turd_flinger_tray_3_color).state, id(ds_turd_flinger_tray_3_active).state});
bambu_display::tally(counts, data);
bambu_display::render_overview(data, {id(ds_turd_flinger_overview_arc), id(ds_turd_flinger_overview_value), id(ds_turd_flinger_overview_detail)});
bambu_display::render_overview(data, {id(ds_turd_flinger_overview_arc), id(ds_turd_flinger_overview_value), id(ds_turd_flinger_overview_finish)});
}
{
bambu_display::Snapshot data;
@@ -1643,8 +1639,7 @@ script:
data.trays.push_back({"A2", id(jordyns_layer_slayer_tray_1_type).state, id(jordyns_layer_slayer_tray_1_color).state, id(jordyns_layer_slayer_tray_1_active).state});
data.trays.push_back({"A3", id(jordyns_layer_slayer_tray_2_type).state, id(jordyns_layer_slayer_tray_2_color).state, id(jordyns_layer_slayer_tray_2_active).state});
data.trays.push_back({"A4", id(jordyns_layer_slayer_tray_3_type).state, id(jordyns_layer_slayer_tray_3_color).state, id(jordyns_layer_slayer_tray_3_active).state});
bambu_display::tally(counts, data);
bambu_display::render_overview(data, {id(jordyns_layer_slayer_overview_arc), id(jordyns_layer_slayer_overview_value), id(jordyns_layer_slayer_overview_detail)});
bambu_display::render_overview(data, {id(jordyns_layer_slayer_overview_arc), id(jordyns_layer_slayer_overview_value), id(jordyns_layer_slayer_overview_finish)});
}
{
bambu_display::Snapshot data;
@@ -1691,8 +1686,7 @@ script:
data.trays.push_back({"B2", id(constipation_orion_tray_5_type).state, id(constipation_orion_tray_5_color).state, id(constipation_orion_tray_5_active).state});
data.trays.push_back({"B3", id(constipation_orion_tray_6_type).state, id(constipation_orion_tray_6_color).state, id(constipation_orion_tray_6_active).state});
data.trays.push_back({"B4", id(constipation_orion_tray_7_type).state, id(constipation_orion_tray_7_color).state, id(constipation_orion_tray_7_active).state});
bambu_display::tally(counts, data);
bambu_display::render_overview(data, {id(constipation_orion_overview_arc), id(constipation_orion_overview_value), id(constipation_orion_overview_detail)});
bambu_display::render_overview(data, {id(constipation_orion_overview_arc), id(constipation_orion_overview_value), id(constipation_orion_overview_finish)});
}
{
bambu_display::Snapshot data;
@@ -1722,8 +1716,7 @@ script:
const auto clock = id(ha_time).now();
if (clock.is_valid() && seconds_left >= 0)
data.finish_time = esphome::ESPTime::from_epoch_local(clock.timestamp + seconds_left).strftime("%H:%M");
bambu_display::tally(counts, data);
bambu_display::render_overview(data, {id(centauri_carbon_overview_arc), id(centauri_carbon_overview_value), id(centauri_carbon_overview_detail)});
bambu_display::render_overview(data, {id(centauri_carbon_overview_arc), id(centauri_carbon_overview_value), id(centauri_carbon_overview_finish)});
}
{
bambu_display::Snapshot data;
@@ -1749,10 +1742,17 @@ script:
const auto clock = id(ha_time).now();
if (clock.is_valid() && seconds_left >= 0)
data.finish_time = esphome::ESPTime::from_epoch_local(clock.timestamp + seconds_left).strftime("%H:%M");
bambu_display::tally(counts, data);
bambu_display::render_overview(data, {id(saturn_overview_arc), id(saturn_overview_value), id(saturn_overview_detail)});
bambu_display::render_overview(data, {id(saturn_overview_arc), id(saturn_overview_value), id(saturn_overview_finish)});
}
{
const auto clock = id(ha_time).now();
std::string clock_text = "--:--";
if (clock.is_valid()) {
clock_text = clock.strftime("%I:%M %p");
if (!clock_text.empty() && clock_text[0] == '0') clock_text.erase(0, 1);
}
bambu_display::set_text(id(fleet_clock), clock_text);
}
bambu_display::render_fleet_summary(id(fleet_summary), counts);
interval:
- interval: 1s
then:
@@ -1819,22 +1819,44 @@ lvgl:
on_load:
- script.execute: fleet_refresh
widgets:
- label:
text: Print Status Overview
x: 16
y: 10
width: 520
height: 30
text_color: 65280
text_font: montserrat_22
long_mode: DOT
gesture_bubble: true
- label:
text: --:--
x: 548
y: 12
width: 236
height: 26
text_color: 15658734
text_font: montserrat_18
long_mode: DOT
gesture_bubble: true
id: fleet_clock
text_align: RIGHT
- arc:
id: prints_charming_overview_arc
x: 23
y: 8
width: 154
height: 154
x: 27
y: 46
width: 145
height: 145
min_value: 0
max_value: 100
value: 0
value: 100
start_angle: 135
end_angle: 45
arc_width: 13
arc_color: 1647403
arc_width: 12
arc_color: 65280
indicator:
arc_color: 65280
arc_width: 13
arc_width: 12
adjustable: false
gesture_bubble: true
clickable: true
@@ -1842,11 +1864,11 @@ lvgl:
- lvgl.page.show: prints_charming_page
- label:
text: --
x: 29
y: 55
width: 142
x: 27
y: 90
width: 145
height: 40
text_color: 15658734
text_color: 16777215
text_font: montserrat_32
long_mode: DOT
gesture_bubble: true
@@ -1856,27 +1878,27 @@ lvgl:
on_click:
- lvgl.page.show: prints_charming_page
- label:
text: SYNCING
x: 29
y: 94
width: 142
height: 22
text_color: 11449271
text_font: montserrat_14
text: '%'
x: 27
y: 124
width: 145
height: 24
text_color: 16777215
text_font: montserrat_16
long_mode: DOT
gesture_bubble: true
id: prints_charming_overview_detail
id: prints_charming_overview_percent
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: prints_charming_page
- label:
text: PrintsCharming
x: 15
y: 145
width: 170
x: 19
y: 193
width: 161
height: 22
text_color: 65280
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
@@ -1884,22 +1906,37 @@ lvgl:
clickable: true
on_click:
- lvgl.page.show: prints_charming_page
- label:
text: --
x: 19
y: 213
width: 161
height: 22
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
id: prints_charming_overview_finish
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: prints_charming_page
- arc:
id: polly_pocket_overview_arc
x: 223
y: 8
width: 154
height: 154
x: 227
y: 46
width: 145
height: 145
min_value: 0
max_value: 100
value: 0
value: 100
start_angle: 135
end_angle: 45
arc_width: 13
arc_color: 1647403
arc_width: 12
arc_color: 65280
indicator:
arc_color: 65280
arc_width: 13
arc_width: 12
adjustable: false
gesture_bubble: true
clickable: true
@@ -1907,11 +1944,11 @@ lvgl:
- lvgl.page.show: polly_pocket_page
- label:
text: --
x: 229
y: 55
width: 142
x: 227
y: 90
width: 145
height: 40
text_color: 15658734
text_color: 16777215
text_font: montserrat_32
long_mode: DOT
gesture_bubble: true
@@ -1921,27 +1958,27 @@ lvgl:
on_click:
- lvgl.page.show: polly_pocket_page
- label:
text: SYNCING
x: 229
y: 94
width: 142
height: 22
text_color: 11449271
text_font: montserrat_14
text: '%'
x: 227
y: 124
width: 145
height: 24
text_color: 16777215
text_font: montserrat_16
long_mode: DOT
gesture_bubble: true
id: polly_pocket_overview_detail
id: polly_pocket_overview_percent
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: polly_pocket_page
- label:
text: Polly-Pocket
x: 215
y: 145
width: 170
x: 219
y: 193
width: 161
height: 22
text_color: 65280
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
@@ -1949,22 +1986,37 @@ lvgl:
clickable: true
on_click:
- lvgl.page.show: polly_pocket_page
- label:
text: --
x: 219
y: 213
width: 161
height: 22
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
id: polly_pocket_overview_finish
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: polly_pocket_page
- arc:
id: ds_turd_flinger_overview_arc
x: 423
y: 8
width: 154
height: 154
x: 427
y: 46
width: 145
height: 145
min_value: 0
max_value: 100
value: 0
value: 100
start_angle: 135
end_angle: 45
arc_width: 13
arc_color: 1647403
arc_width: 12
arc_color: 65280
indicator:
arc_color: 65280
arc_width: 13
arc_width: 12
adjustable: false
gesture_bubble: true
clickable: true
@@ -1972,11 +2024,11 @@ lvgl:
- lvgl.page.show: ds_turd_flinger_page
- label:
text: --
x: 429
y: 55
width: 142
x: 427
y: 90
width: 145
height: 40
text_color: 15658734
text_color: 16777215
text_font: montserrat_32
long_mode: DOT
gesture_bubble: true
@@ -1986,27 +2038,27 @@ lvgl:
on_click:
- lvgl.page.show: ds_turd_flinger_page
- label:
text: SYNCING
x: 429
y: 94
width: 142
height: 22
text_color: 11449271
text_font: montserrat_14
text: '%'
x: 427
y: 124
width: 145
height: 24
text_color: 16777215
text_font: montserrat_16
long_mode: DOT
gesture_bubble: true
id: ds_turd_flinger_overview_detail
id: ds_turd_flinger_overview_percent
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: ds_turd_flinger_page
- label:
text: Ds-Turd-Flinger
x: 415
y: 145
width: 170
x: 419
y: 193
width: 161
height: 22
text_color: 65280
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
@@ -2014,22 +2066,37 @@ lvgl:
clickable: true
on_click:
- lvgl.page.show: ds_turd_flinger_page
- label:
text: --
x: 419
y: 213
width: 161
height: 22
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
id: ds_turd_flinger_overview_finish
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: ds_turd_flinger_page
- arc:
id: jordyns_layer_slayer_overview_arc
x: 623
y: 8
width: 154
height: 154
x: 627
y: 46
width: 145
height: 145
min_value: 0
max_value: 100
value: 0
value: 100
start_angle: 135
end_angle: 45
arc_width: 13
arc_color: 1647403
arc_width: 12
arc_color: 65280
indicator:
arc_color: 65280
arc_width: 13
arc_width: 12
adjustable: false
gesture_bubble: true
clickable: true
@@ -2037,11 +2104,11 @@ lvgl:
- lvgl.page.show: jordyns_layer_slayer_page
- label:
text: --
x: 629
y: 55
width: 142
x: 627
y: 90
width: 145
height: 40
text_color: 15658734
text_color: 16777215
text_font: montserrat_32
long_mode: DOT
gesture_bubble: true
@@ -2051,27 +2118,27 @@ lvgl:
on_click:
- lvgl.page.show: jordyns_layer_slayer_page
- label:
text: SYNCING
x: 629
y: 94
width: 142
height: 22
text_color: 11449271
text_font: montserrat_14
text: '%'
x: 627
y: 124
width: 145
height: 24
text_color: 16777215
text_font: montserrat_16
long_mode: DOT
gesture_bubble: true
id: jordyns_layer_slayer_overview_detail
id: jordyns_layer_slayer_overview_percent
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: jordyns_layer_slayer_page
- label:
text: Jordyns-Layer-Slayer
x: 615
y: 145
width: 170
x: 619
y: 193
width: 161
height: 22
text_color: 65280
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
@@ -2079,22 +2146,37 @@ lvgl:
clickable: true
on_click:
- lvgl.page.show: jordyns_layer_slayer_page
- label:
text: --
x: 619
y: 213
width: 161
height: 22
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
id: jordyns_layer_slayer_overview_finish
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: jordyns_layer_slayer_page
- arc:
id: constipation_orion_overview_arc
x: 123
y: 204
width: 154
height: 154
x: 127
y: 239
width: 145
height: 145
min_value: 0
max_value: 100
value: 0
value: 100
start_angle: 135
end_angle: 45
arc_width: 13
arc_color: 1647403
arc_width: 12
arc_color: 65280
indicator:
arc_color: 65280
arc_width: 13
arc_width: 12
adjustable: false
gesture_bubble: true
clickable: true
@@ -2102,11 +2184,11 @@ lvgl:
- lvgl.page.show: constipation_orion_page
- label:
text: --
x: 129
y: 251
width: 142
x: 127
y: 283
width: 145
height: 40
text_color: 15658734
text_color: 16777215
text_font: montserrat_32
long_mode: DOT
gesture_bubble: true
@@ -2116,27 +2198,27 @@ lvgl:
on_click:
- lvgl.page.show: constipation_orion_page
- label:
text: SYNCING
x: 129
y: 290
width: 142
height: 22
text_color: 11449271
text_font: montserrat_14
text: '%'
x: 127
y: 317
width: 145
height: 24
text_color: 16777215
text_font: montserrat_16
long_mode: DOT
gesture_bubble: true
id: constipation_orion_overview_detail
id: constipation_orion_overview_percent
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: constipation_orion_page
- label:
text: Constipation-Orion
x: 115
y: 341
width: 170
x: 119
y: 386
width: 161
height: 22
text_color: 65280
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
@@ -2144,22 +2226,37 @@ lvgl:
clickable: true
on_click:
- lvgl.page.show: constipation_orion_page
- label:
text: --
x: 119
y: 406
width: 161
height: 22
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
id: constipation_orion_overview_finish
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: constipation_orion_page
- arc:
id: centauri_carbon_overview_arc
x: 323
y: 204
width: 154
height: 154
x: 327
y: 239
width: 145
height: 145
min_value: 0
max_value: 100
value: 0
value: 100
start_angle: 135
end_angle: 45
arc_width: 13
arc_color: 1647403
arc_width: 12
arc_color: 65280
indicator:
arc_color: 65280
arc_width: 13
arc_width: 12
adjustable: false
gesture_bubble: true
clickable: true
@@ -2167,11 +2264,11 @@ lvgl:
- lvgl.page.show: centauri_carbon_page
- label:
text: --
x: 329
y: 251
width: 142
x: 327
y: 283
width: 145
height: 40
text_color: 15658734
text_color: 16777215
text_font: montserrat_32
long_mode: DOT
gesture_bubble: true
@@ -2181,27 +2278,27 @@ lvgl:
on_click:
- lvgl.page.show: centauri_carbon_page
- label:
text: SYNCING
x: 329
y: 290
width: 142
height: 22
text_color: 11449271
text_font: montserrat_14
text: '%'
x: 327
y: 317
width: 145
height: 24
text_color: 16777215
text_font: montserrat_16
long_mode: DOT
gesture_bubble: true
id: centauri_carbon_overview_detail
id: centauri_carbon_overview_percent
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: centauri_carbon_page
- label:
text: Centauri Carbon
x: 315
y: 341
width: 170
x: 319
y: 386
width: 161
height: 22
text_color: 65280
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
@@ -2209,22 +2306,37 @@ lvgl:
clickable: true
on_click:
- lvgl.page.show: centauri_carbon_page
- label:
text: --
x: 319
y: 406
width: 161
height: 22
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
id: centauri_carbon_overview_finish
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: centauri_carbon_page
- arc:
id: saturn_overview_arc
x: 523
y: 204
width: 154
height: 154
x: 527
y: 239
width: 145
height: 145
min_value: 0
max_value: 100
value: 0
value: 100
start_angle: 135
end_angle: 45
arc_width: 13
arc_color: 1647403
arc_width: 12
arc_color: 65280
indicator:
arc_color: 65280
arc_width: 13
arc_width: 12
adjustable: false
gesture_bubble: true
clickable: true
@@ -2232,11 +2344,11 @@ lvgl:
- lvgl.page.show: saturn_page
- label:
text: --
x: 529
y: 251
width: 142
x: 527
y: 283
width: 145
height: 40
text_color: 15658734
text_color: 16777215
text_font: montserrat_32
long_mode: DOT
gesture_bubble: true
@@ -2246,27 +2358,27 @@ lvgl:
on_click:
- lvgl.page.show: saturn_page
- label:
text: SYNCING
x: 529
y: 290
width: 142
height: 22
text_color: 11449271
text_font: montserrat_14
text: '%'
x: 527
y: 317
width: 145
height: 24
text_color: 16777215
text_font: montserrat_16
long_mode: DOT
gesture_bubble: true
id: saturn_overview_detail
id: saturn_overview_percent
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: saturn_page
- label:
text: Saturn
x: 515
y: 341
width: 170
x: 519
y: 386
width: 161
height: 22
text_color: 65280
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
@@ -2275,17 +2387,20 @@ lvgl:
on_click:
- lvgl.page.show: saturn_page
- label:
text: SYNCING
x: 90
y: 404
width: 620
text: --
x: 519
y: 406
width: 161
height: 22
text_color: 11449271
text_color: 15658734
text_font: montserrat_14
long_mode: DOT
gesture_bubble: true
id: fleet_summary
id: saturn_overview_finish
text_align: CENTER
clickable: true
on_click:
- lvgl.page.show: saturn_page
- button:
x: 16
y: 446