@@ -183,6 +183,30 @@ select:
183
183
return "";
184
184
}
185
185
- script.execute : preview_rfid_data
186
+ switch :
187
+ - platform : template
188
+ name : " Include alpha value in filament color"
189
+ id : filament_include_alpha
190
+ state_topic :
191
+ icon : " mdi:palette-outline"
192
+ optimistic : true
193
+ web_server :
194
+ sorting_group_id : sorting_group_filament_settings
195
+ sorting_weight : 70
196
+ turn_on_action :
197
+ then :
198
+ - lambda : |-
199
+ id(filament_include_alpha).publish_state(true);
200
+ char hexStr[3];
201
+ sprintf(hexStr, "%02X", (int)id(filament_alpha_int).state);
202
+ id(filament_alpha).publish_state(hexStr);
203
+ - script.execute : preview_rfid_data
204
+ turn_off_action :
205
+ then :
206
+ - lambda : |-
207
+ id(filament_include_alpha).publish_state(false);
208
+ id(filament_alpha).publish_state("");
209
+ - script.execute : preview_rfid_data
186
210
number :
187
211
- platform : template
188
212
name : " Filament Min Temp"
@@ -231,6 +255,29 @@ number:
231
255
on_value :
232
256
then :
233
257
- script.execute : preview_rfid_data
258
+ - platform : template
259
+ name : " Filament alpha value"
260
+ id : filament_alpha_int
261
+ state_topic :
262
+ min_value : 0
263
+ max_value : 255
264
+ initial_value : 255
265
+ step : 5
266
+ icon : mdi:palette-outline
267
+ optimistic : true
268
+ web_server :
269
+ sorting_group_id : sorting_group_filament_settings
270
+ sorting_weight : 90
271
+ set_action :
272
+ then :
273
+ - lambda : |-
274
+ id(filament_alpha_int).publish_state(int(round(x)));
275
+ char hexStr[3];
276
+ sprintf(hexStr, "%02X", (int)id(filament_alpha_int).state);
277
+ id(filament_alpha).publish_state(hexStr);
278
+ on_value :
279
+ then :
280
+ - script.execute : preview_rfid_data
234
281
text_sensor :
235
282
- platform : template
236
283
name : " Filament Brand Code"
@@ -240,20 +287,32 @@ text_sensor:
240
287
web_server :
241
288
sorting_group_id : sorting_group_filament_settings
242
289
sorting_weight : 110
243
- on_value :
244
- then :
245
- - script.execute : preview_rfid_data
290
+ # on_value: #not needed?
291
+ # then:
292
+ # - script.execute: preview_rfid_data
246
293
- platform : template
247
294
name : " Filament Color Hex"
248
295
id : filament_color_hex
249
296
state_topic :
250
297
icon : mdi:hexagon-outline
298
+ internal : true
251
299
web_server :
252
300
sorting_group_id : sorting_group_filament_settings
253
301
sorting_weight : 100
254
- on_value :
255
- then :
256
- - script.execute : preview_rfid_data
302
+ # on_value: #not needed?
303
+ # then:
304
+ # - script.execute: preview_rfid_data
305
+ - platform : template
306
+ name : " Filament Color Hex"
307
+ id : filament_color_hexaa
308
+ state_topic :
309
+ icon : mdi:hexagon-outline
310
+ web_server :
311
+ sorting_group_id : sorting_group_filament_settings
312
+ sorting_weight : 105
313
+ # on_value: #not needed?
314
+ # then:
315
+ # - script.execute: preview_rfid_data
257
316
- platform : template
258
317
name : Filament Sub Brand
259
318
id : filament_sub_brand
@@ -262,9 +321,15 @@ text_sensor:
262
321
web_server :
263
322
sorting_group_id : sorting_group_filament_settings
264
323
sorting_weight : 120
265
- on_value :
266
- then :
267
- - script.execute : preview_rfid_data
324
+ # on_value: #not needed?
325
+ # then:
326
+ # - script.execute: preview_rfid_data
327
+ - platform : template
328
+ name : Filament alpha
329
+ id : filament_alpha
330
+ state_topic :
331
+ icon : mdi:label
332
+ internal : true
268
333
button :
269
334
- platform : template
270
335
name : Upload Settings
0 commit comments