File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -120,8 +120,8 @@ namespace bambulabs
120
120
}
121
121
}
122
122
123
- if (doc_in[" color_hex" ].as <std::string>().length () != 6 ) {
124
- ESP_LOGE (" bambu" , " Invalid color_hex length (expected 6 characters)" );
123
+ if (doc_in[" color_hex" ].as <std::string>().length () != 6 && doc_in[ " color_hex " ]. as <std::string>(). length () != 8 ) {
124
+ ESP_LOGE (" bambu" , " Invalid color_hex length (expected 6 or 8 characters)" );
125
125
return {};
126
126
}
127
127
@@ -130,7 +130,12 @@ namespace bambulabs
130
130
print[" command" ] = " ams_filament_setting" ;
131
131
print[" ams_id" ] = ams_id;
132
132
print[" tray_id" ] = ams_tray;
133
- print[" tray_color" ] = doc_in[" color_hex" ].as <std::string>() + " FF" ;
133
+ if (doc_in[" color_hex" ].as <std::string>().length () == 6 ) {
134
+ print[" tray_color" ] = doc_in[" color_hex" ].as <std::string>() + " FF" ;
135
+ }
136
+ else {
137
+ print[" tray_color" ] = doc_in[" color_hex" ].as <std::string>();
138
+ }
134
139
print[" nozzle_temp_min" ] = uint16_t (doc_in[" min_temp" ]); // if not string or int, will fall back to 0
135
140
print[" nozzle_temp_max" ] = uint16_t (doc_in[" max_temp" ]); // if not string or int, will fall back to 0
136
141
print[" tray_type" ] = doc_in[" type" ];
You can’t perform that action at this time.
0 commit comments