Skip to content

Commit

Permalink
fix(xiaomi_lock_report): improve conversion of key error messages (Ko…
Browse files Browse the repository at this point in the history
  • Loading branch information
aesedepece authored and Koenkk committed Dec 7, 2018
1 parent 3bb5b4c commit e89e1d8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,15 @@ const converters = {
const state = data.substr(2, 2);
const action = data.substr(4, 2);
const keynum = data.substr(6, 2);
if (state == 11 && action == 7) {
// wrong key or not success inserted
return {keyerror: true};
if (state == 11) {
if (action == 1) {
// unknown key
return {keyerror: true, inserted: 'unknown'};
}
if (action == 3) {
// explicitly disabled key (e.g.: reported lost)
return {keyerror: true, inserted: keynum};
}
}
if (state == 12) {
if (action == 1) {
Expand Down

0 comments on commit e89e1d8

Please sign in to comment.