Skip to content

Commit

Permalink
Fix model detection and remove serial_number if not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Jan 26, 2025
1 parent 9708066 commit e52eb3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions components/tc_bus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

CONF_MODELS = [
"None",
"TCS ISW3030 / Koch TC50",
"TCS ISW3030 / Koch TC50 / Scantron Stilux",
"TCS ISW3130 / Koch TC50P",
"TCS ISW3230 / Koch TC50 GFA",
"TCS ISW3330 / Koch TC50 BW",
Expand Down Expand Up @@ -121,18 +121,18 @@
"TCS TC20F",
"TCS ISH3340",
"TCS ISH3022 / Koch TCH50P",
"TCS ISH3130 / Koch TCH50P",
"TCS ISH3130 / Koch TCH50P / Scantron LuxPlus",
"TCS ISW3022",
"TCS ISH3230 / Koch TCH50 GFA",
"TCS ISH3030 / Koch TCH50",
"TCS ISH3030 / Koch TCH50 / Scantron Lux2",
"TCS ISH1030 / Koch TTS25",
"TCS IMM1000 / Koch TCH30",
"TCS IMM1100 / Koch TCHE30",
"TCS IMM1300 / Koch VTCH30",
"TCS IMM1500",
"TCS IMM1310 / Koch VTCHE30",
"TCS IMM1110 / Koch TCHEE30",
"TCS IVH3222 / Koch VTCH50",
"TCS IVH3222 / Koch VTCH50 / Scantron VLux",
"TCS IVH4222 / Koch VTCH50/2D",
"TCS IVW2220 / Koch Sky",
"TCS IVW2221 / Koch Sky R1.00",
Expand Down
7 changes: 3 additions & 4 deletions components/tc_bus/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ namespace esphome
{
data.type = COMMAND_TYPE_FOUND_DOORMAN_DEVICE;
data.payload = command & 0xFFFFFF; // MAC Address
data.serial_number = 0;
}
break;

Expand All @@ -287,17 +288,15 @@ namespace esphome
data.type = COMMAND_TYPE_WRITE_MEMORY;
data.address = (command >> 16) & 0xFF;
data.payload = command & 0xFFFF;
data.serial_number = 0;
break;
}
break;
}
}
else
{
if (data.command_hex.substr(0, 4) == "0000")
{
data.command_hex = data.command_hex.substr(4);
}
data.command_hex = data.command_hex.substr(4);

// For 16-bit commands, work on the lower 16 bits
uint8_t first = (command >> 12) & 0xF;
Expand Down

0 comments on commit e52eb3e

Please sign in to comment.