mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 22:48:10 +01:00
handle Wiegand 8-bit keys (#4837)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
This commit is contained in:
parent
492bad645b
commit
edfd82fd42
1 changed files with 10 additions and 0 deletions
|
@ -102,6 +102,16 @@ void Wiegand::loop() {
|
||||||
uint8_t key = KEYS[value];
|
uint8_t key = KEYS[value];
|
||||||
this->send_key_(key);
|
this->send_key_(key);
|
||||||
}
|
}
|
||||||
|
} else if (count == 8) {
|
||||||
|
if ((value ^ 0xf0) >> 4 == (value & 0xf)) {
|
||||||
|
value &= 0xf;
|
||||||
|
for (auto *trigger : this->key_triggers_)
|
||||||
|
trigger->trigger(value);
|
||||||
|
if (value < 12) {
|
||||||
|
uint8_t key = KEYS[value];
|
||||||
|
this->send_key_(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGD(TAG, "received unknown %d-bit value: %llx", count, value);
|
ESP_LOGD(TAG, "received unknown %d-bit value: %llx", count, value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue