Hallo Zusammen,
ich verzweifel gerade an der Farbe eines Icons.
Ich möchte mein Keymatic ansteuern (das geht) auch. Lock und Unlock.
Nun möchte ich, dass das Icon sich ensprechend ändert, das geht auch.
Leider ist das Ding immer orange.
Ich hätte gerne orange bei Locked und grau bei unlocked.
Also nicht das Schloßicon, sondern den Kreis rundrum.
Ich habe alles mögliche an data-on-color, data-off-color, data-off-background, usw.
Hier die aktuell Zeile aus der index.html:
<div data-type="switch" data-device="CUL_HM_HM_SEC_KEY_23DB96" data-get="lock" data-get-on='["locked.*","unlocked.*"]' data-icons='["fa-lock","fa-unlock"]' data-set-on="lock" data-set-off="unlock" data-off-color="#848484" data-off-background-color="#505050" class="cell"></div>
Du musst die Farben in ein Array schreiben:
data-get="battery"
data-states='["ok", "low"]'
data-icons='["fa-circle-o","fa-circle"]'
data-colors='["green", "red"]'>
Dieses Beispiel zeigt einen grünen Kreisring, wenn die Batterie okay ist, aber einen roten Kreis, wenn der Batteriezustand "low" ist.
Ach ja...
Wenn du noch einen Ring drumrum habe willst, musst du noch das Folgende dazu packen...
data-background-icon = "fa-circle-thin"
data-background-color="gray"
Damit müsste es klappen.
Funzt leider nicht.
Egal ob locked oder unlocked, der Kreis bleibt orange. ???
<div data-type="switch"
data-device="CUL_HM_HM_SEC_KEY_23DB96"
data-get="lock"
data-get-on='["locked.*","unlocked.*"]'
data-icons='["fa-lock","fa-unlock"]'
data-set-on="lock"
data-set-off="unlock"
data-color='["#505050","#848484"]'
class="cell"></div>
Da muss noch data-background-color="['#de5500',...
rein
geht leider auch nicht
sorry, mein Fehler data-background-colors (mit s - Mehrzahl)
<div data-type="switch" data-device="dummy1"
data-get="lock" data-get-on='["locked.*","unlocked.*"]'
data-icons='["fa-lock","fa-unlock"]'
data-set-on="lock" data-set-off="unlock"
data-background-colors='["#848484","#00A8FD"]'
class="cell"></div>
Das war es!!
Vielen Dank!!