mirror of
https://github.com/esphome/esphome.git
synced 2024-11-29 18:24:13 +01:00
handle Wiegand 8-bit keys (#4837)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
This commit is contained in:
parent
cc76e5353c
commit
c941bc4109
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