diff --git a/custom_cards/custom_card_eraycetinay_lock/README.md b/custom_cards/custom_card_eraycetinay_lock/README.md index 777c75ac2..9b3bb9e06 100644 --- a/custom_cards/custom_card_eraycetinay_lock/README.md +++ b/custom_cards/custom_card_eraycetinay_lock/README.md @@ -107,6 +107,20 @@ Version: 0.0.3 no Displays a warning when the door is lock but the door is still open. + + ulm_custom_card_eraycetinay_lock_battery_sensor_binary + true + false + no + Set to true if using a binary battery sensor. Will ignore battery_warning percentage settings + + + ulm_custom_card_eraycetinay_lock_battery_sensor_binary_low_state + off + on + no + Set whether the binary sensor turns to on or off when in low state + ??? note "Template Code" diff --git a/custom_cards/custom_card_eraycetinay_lock/custom_card_eraycetinay_lock.yaml b/custom_cards/custom_card_eraycetinay_lock/custom_card_eraycetinay_lock.yaml index 4c2447996..8a20e4b99 100644 --- a/custom_cards/custom_card_eraycetinay_lock/custom_card_eraycetinay_lock.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/custom_card_eraycetinay_lock.yaml @@ -7,6 +7,8 @@ custom_card_eraycetinay_lock: variables: ulm_custom_card_eraycetinay_lock_battery_warning: 20 ulm_custom_card_eraycetinay_lock_battery_warning_low: 5 + ulm_custom_card_eraycetinay_lock_battery_sensor_binary: false + ulm_custom_card_eraycetinay_lock_battery_sensor_binary_low_state: "on" tap_action: action: | [[[ @@ -89,10 +91,16 @@ custom_card_eraycetinay_lock: - background-color: | [[[ if (variables.ulm_custom_card_eraycetinay_lock_battery_level !== undefined) { - if (states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state <= variables.ulm_custom_card_eraycetinay_lock_battery_warning_low) { - return "rgba(var(--color-red),1)"; - } else if (states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state <= variables.ulm_custom_card_eraycetinay_lock_battery_warning) { - return "rgba(var(--color-yellow),1)"; + if (variables.ulm_custom_card_eraycetinay_lock_battery_sensor_binary) { + if (states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state == variables.ulm_custom_card_eraycetinay_lock_battery_sensor_binary_low_state) { + return "rgba(var(--color-red),1)"; + } + } else { + if (states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state <= variables.ulm_custom_card_eraycetinay_lock_battery_warning_low) { + return "rgba(var(--color-red),1)"; + } else if (states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state <= variables.ulm_custom_card_eraycetinay_lock_battery_warning) { + return "rgba(var(--color-yellow),1)"; + } } } ]]] @@ -106,10 +114,18 @@ custom_card_eraycetinay_lock: notification_battery: > [[[ if (variables.ulm_custom_card_eraycetinay_lock_battery_level !== undefined) { - if (variables.ulm_custom_card_eraycetinay_lock_battery_warning >= states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state) { - return ` - - `; + if (variables.ulm_custom_card_eraycetinay_lock_battery_sensor_binary) { + if (states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state == variables.ulm_custom_card_eraycetinay_lock_battery_sensor_binary_low_state) { + return ` + + `; + } + } else { + if (variables.ulm_custom_card_eraycetinay_lock_battery_warning >= states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state) { + return ` + + `; + } } } ]]] diff --git a/custom_cards/custom_card_eraycetinay_lock/languages/de.yaml b/custom_cards/custom_card_eraycetinay_lock/languages/de.yaml index 1305d95eb..d97a28f11 100644 --- a/custom_cards/custom_card_eraycetinay_lock/languages/de.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/languages/de.yaml @@ -1,11 +1,12 @@ --- custom_card_eraycetinay_lock_language_variables: variables: - custom_card_eraycetinay_lock_locked: "verriegelt" - custom_card_eraycetinay_lock_unlocked: "entriegelt" - custom_card_eraycetinay_lock_locking: "verriegeln" - custom_card_eraycetinay_lock_unlocking: "entriegeln" - custom_card_eraycetinay_lock_unavailable: "nicht verfügbar" - custom_card_eraycetinay_lock_jammed: "blockiert" - custom_card_eraycetinay_lock_locked_and_opened: "Die Tür ist verschlossen, aber noch offen." - custom_card_eraycetinay_lock_battery_is_at: "Batterie ist an" + ulm_custom_card_eraycetinay_lock_locked: "verriegelt" + ulm_custom_card_eraycetinay_lock_unlocked: "entriegelt" + ulm_custom_card_eraycetinay_lock_locking: "verriegeln" + ulm_custom_card_eraycetinay_lock_unlocking: "entriegeln" + ulm_custom_card_eraycetinay_lock_unavailable: "nicht verfügbar" + ulm_custom_card_eraycetinay_lock_jammed: "blockiert" + ulm_custom_card_eraycetinay_lock_locked_and_opened: "Die Tür ist verschlossen, aber noch offen." + ulm_custom_card_eraycetinay_lock_battery_is_at: "Batterie ist an" + ulm_custom_card_eraycetinay_lock_battery_is_low: "Batterie schwach" diff --git a/custom_cards/custom_card_eraycetinay_lock/languages/en.yaml b/custom_cards/custom_card_eraycetinay_lock/languages/en.yaml index f34a60515..81579b70b 100644 --- a/custom_cards/custom_card_eraycetinay_lock/languages/en.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/languages/en.yaml @@ -1,11 +1,12 @@ --- custom_card_eraycetinay_lock_language_variables: variables: - custom_card_eraycetinay_lock_locked: "locked" - custom_card_eraycetinay_lock_unlocked: "unlocked" - custom_card_eraycetinay_lock_locking: "locking" - custom_card_eraycetinay_lock_unlocking: "unlocking" - custom_card_eraycetinay_lock_unavailable: "unavailable" - custom_card_eraycetinay_lock_jammed: "jammed" - custom_card_eraycetinay_lock_locked_and_opened: "The door is locked but still open." - custom_card_eraycetinay_lock_battery_is_at: "Battery is at" + ulm_custom_card_eraycetinay_lock_locked: "locked" + ulm_custom_card_eraycetinay_lock_unlocked: "unlocked" + ulm_custom_card_eraycetinay_lock_locking: "locking" + ulm_custom_card_eraycetinay_lock_unlocking: "unlocking" + ulm_custom_card_eraycetinay_lock_unavailable: "unavailable" + ulm_custom_card_eraycetinay_lock_jammed: "jammed" + ulm_custom_card_eraycetinay_lock_locked_and_opened: "The door is locked but still open." + ulm_custom_card_eraycetinay_lock_battery_is_at: "Battery is at" + ulm_custom_card_eraycetinay_lock_battery_is_low: "Battery is low" diff --git a/custom_cards/custom_card_eraycetinay_lock/languages/es.yaml b/custom_cards/custom_card_eraycetinay_lock/languages/es.yaml index 637d3c74c..3281e2ee1 100644 --- a/custom_cards/custom_card_eraycetinay_lock/languages/es.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/languages/es.yaml @@ -1,11 +1,12 @@ --- custom_card_eraycetinay_lock_language_variables: variables: - custom_card_eraycetinay_lock_locked: "bloqueado" - custom_card_eraycetinay_lock_unlocked: "desbloqueado" - custom_card_eraycetinay_lock_locking: "bloqueando" - custom_card_eraycetinay_lock_unlocking: "desbloqueando" - custom_card_eraycetinay_lock_unavailable: "no disponible" - custom_card_eraycetinay_lock_jammed: "apretada" - custom_card_eraycetinay_lock_locked_and_opened: "La puerta está cerrada pero aún abierta." - custom_card_eraycetinay_lock_battery_is_at: "la batería está en" + ulm_custom_card_eraycetinay_lock_locked: "bloqueado" + ulm_custom_card_eraycetinay_lock_unlocked: "desbloqueado" + ulm_custom_card_eraycetinay_lock_locking: "bloqueando" + ulm_custom_card_eraycetinay_lock_unlocking: "desbloqueando" + ulm_custom_card_eraycetinay_lock_unavailable: "no disponible" + ulm_custom_card_eraycetinay_lock_jammed: "apretada" + ulm_custom_card_eraycetinay_lock_locked_and_opened: "La puerta está cerrada pero aún abierta." + ulm_custom_card_eraycetinay_lock_battery_is_at: "la batería está en" + ulm_custom_card_eraycetinay_lock_battery_is_low: "La batería está baja" diff --git a/custom_cards/custom_card_eraycetinay_lock/languages/pl.yaml b/custom_cards/custom_card_eraycetinay_lock/languages/pl.yaml index b00d13270..edfaba02f 100644 --- a/custom_cards/custom_card_eraycetinay_lock/languages/pl.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/languages/pl.yaml @@ -1,11 +1,12 @@ --- custom_card_eraycetinay_lock_language_variables: variables: - custom_card_eraycetinay_lock_locked: "zamknięty" - custom_card_eraycetinay_lock_unlocked: "otwarty" - custom_card_eraycetinay_lock_locking: "zamykanie" - custom_card_eraycetinay_lock_unlocking: "otwieranie" - custom_card_eraycetinay_lock_unavailable: "niedostępny" - custom_card_eraycetinay_lock_jammed: "zacięty" - custom_card_eraycetinay_lock_locked_and_opened: "Drzwi są zamknięte, ale nadal otwarte." - custom_card_eraycetinay_lock_battery_is_at: "Bateria jest na" + ulm_custom_card_eraycetinay_lock_locked: "zamknięty" + ulm_custom_card_eraycetinay_lock_unlocked: "otwarty" + ulm_custom_card_eraycetinay_lock_locking: "zamykanie" + ulm_custom_card_eraycetinay_lock_unlocking: "otwieranie" + ulm_custom_card_eraycetinay_lock_unavailable: "niedostępny" + ulm_custom_card_eraycetinay_lock_jammed: "zacięty" + ulm_custom_card_eraycetinay_lock_locked_and_opened: "Drzwi są zamknięte, ale nadal otwarte." + ulm_custom_card_eraycetinay_lock_battery_is_at: "Bateria jest na" + ulm_custom_card_eraycetinay_lock_battery_is_low: "Bateria jest słaba" diff --git a/custom_cards/custom_card_eraycetinay_lock/languages/sv.yaml b/custom_cards/custom_card_eraycetinay_lock/languages/sv.yaml index 707eab945..858d90629 100644 --- a/custom_cards/custom_card_eraycetinay_lock/languages/sv.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/languages/sv.yaml @@ -1,11 +1,12 @@ --- custom_card_eraycetinay_lock_language_variables: variables: - custom_card_eraycetinay_lock_locked: "låst" - custom_card_eraycetinay_lock_unlocked: "olåst" - custom_card_eraycetinay_lock_locking: "låser" - custom_card_eraycetinay_lock_unlocking: "låser upp" - custom_card_eraycetinay_lock_unavailable: "otillgängligt" - custom_card_eraycetinay_lock_jammed: "fastnat" - custom_card_eraycetinay_lock_locked_and_opened: "Dörren är låst men fortfarande öppen." - custom_card_eraycetinay_lock_battery_is_at: "Batterinivån är" + ulm_custom_card_eraycetinay_lock_locked: "låst" + ulm_custom_card_eraycetinay_lock_unlocked: "olåst" + ulm_custom_card_eraycetinay_lock_locking: "låser" + ulm_custom_card_eraycetinay_lock_unlocking: "låser upp" + ulm_custom_card_eraycetinay_lock_unavailable: "otillgängligt" + ulm_custom_card_eraycetinay_lock_jammed: "fastnat" + ulm_custom_card_eraycetinay_lock_locked_and_opened: "Dörren är låst men fortfarande öppen." + ulm_custom_card_eraycetinay_lock_battery_is_at: "Batterinivån är" + ulm_custom_card_eraycetinay_lock_battery_is_low: "Batteriet är lågt" diff --git a/custom_cards/custom_card_eraycetinay_lock/languages/tr.yaml b/custom_cards/custom_card_eraycetinay_lock/languages/tr.yaml index e612ab5f2..71087a982 100644 --- a/custom_cards/custom_card_eraycetinay_lock/languages/tr.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/languages/tr.yaml @@ -1,11 +1,12 @@ --- custom_card_eraycetinay_lock_language_variables: variables: - custom_card_eraycetinay_lock_locked: "kilitli" - custom_card_eraycetinay_lock_unlocked: "kilitli değil" - custom_card_eraycetinay_lock_locking: "kilitleniyor" - custom_card_eraycetinay_lock_unlocking: "kilit açılıyor" - custom_card_eraycetinay_lock_unavailable: "müsait değil" - custom_card_eraycetinay_lock_jammed: "sıkışmış" - custom_card_eraycetinay_lock_locked_and_opened: "Kapı kilitli ama hala açık" - custom_card_eraycetinay_lock_battery_is_at: "pil" + ulm_custom_card_eraycetinay_lock_locked: "kilitli" + ulm_custom_card_eraycetinay_lock_unlocked: "kilitli değil" + ulm_custom_card_eraycetinay_lock_locking: "kilitleniyor" + ulm_custom_card_eraycetinay_lock_unlocking: "kilit açılıyor" + ulm_custom_card_eraycetinay_lock_unavailable: "müsait değil" + ulm_custom_card_eraycetinay_lock_jammed: "sıkışmış" + ulm_custom_card_eraycetinay_lock_locked_and_opened: "Kapı kilitli ama hala açık" + ulm_custom_card_eraycetinay_lock_battery_is_at: "pil" + ulm_custom_card_eraycetinay_lock_battery_is_low: "pil zayıf"