OpenPrintTag reader: filament color light falls back to the Creality tag
CI / ESPHome config validation (push) Failing after 6s
CI / YAML lint (push) Failing after 17s

This commit is contained in:
randy committed 2026-10-10 12:35:49 +02:00
1 parent 7cc90187d1
commit 05060756e3
1 file changed
+13 -1
+13 -1
View File
@@ -182,6 +182,9 @@ text_sensor:
- platform: creality_cfs - platform: creality_cfs
type: color type: color
name: Creality color name: Creality color
id: creality_color
on_value:
- script.execute: show_filament_color
- platform: creality_cfs - platform: creality_cfs
type: serial type: serial
name: Creality serial name: Creality serial
@@ -197,9 +200,18 @@ text_sensor:
- platform: openprinttag - platform: openprinttag
type: primary_color type: primary_color
name: Color name: Color
# Mirrored to the filament_color light, empty = no tag id: openprinttag_color
on_value: on_value:
- script.execute: show_filament_color
script:
# The filament color on the filament_color light: the OpenPrintTag's, else the Creality tag's
- id: show_filament_color
then:
- lambda: |- - lambda: |-
std::string x = id(openprinttag_color).state;
if (x.size() < 7)
x = id(creality_color).state;
if (x.size() < 7) { if (x.size() < 7) {
id(filament_color).turn_off().set_transition_length(0).perform(); id(filament_color).turn_off().set_transition_length(0).perform();
return; return;