Skip to content

Commit

Permalink
Fix serial number reference
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Sep 17, 2024
1 parent 17b3e75 commit ede6279
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/tcs_intercom/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace esphome

if (data.length == 32)
{
data.serial = (command >> 8) & 0xFFFFF; // Serial (from bits 8 to 23)
data.serial_number = (command >> 8) & 0xFFFFF; // Serial (from bits 8 to 23)

switch ((command >> 28) & 0xF)
{
Expand Down
2 changes: 1 addition & 1 deletion components/tcs_intercom/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace esphome
std::string command_hex;
CommandType type;
uint8_t address;
uint32_t serial;
uint32_t serial_number;
uint8_t length;
};

Expand Down
6 changes: 3 additions & 3 deletions components/tcs_intercom/tcs_intercom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ namespace esphome

// Parse Command
CommandData cmd_data = parseCommand(command);
ESP_LOGD(TAG, "[Parsed] Type: %s, Address: %i, Serial: %i", command_type_to_string(cmd_data.type), cmd_data.address, cmd_data.serial);
ESP_LOGD(TAG, "[Parsed] Type: %s, Address: %i, Serial: %i", command_type_to_string(cmd_data.type), cmd_data.address, cmd_data.serial_number);

// Update Door Readiness Status
if (cmd_data.type == COMMAND_TYPE_START_TALKING_DOOR_STATION) {
Expand Down Expand Up @@ -382,7 +382,7 @@ namespace esphome
}
} else if (cmd_data.type == listener_type && cmd_data.address == listener_address) {
if (listener_serial_number != 0) {
if (cmd_data.serial == listener_serial_number) {
if (cmd_data.serial_number == listener_serial_number) {
allow_publish = true;
}
} else {
Expand All @@ -404,7 +404,7 @@ namespace esphome
{"command", cmd_data.command_hex},
{"type", command_type_to_string(cmd_data.type)},
{"address", std::to_string(cmd_data.address)},
{"serial_number", std::to_string(cmd_data.serial)}
{"serial_number", std::to_string(cmd_data.serial_number)}
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/de/reference/esphome-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ struct CommandData {
std::string command_hex;
CommandType type;
uint8_t address;
uint32_t serial;
uint32_t serial_number;
uint8_t length;
};
```
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/esphome-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ struct CommandData {
std::string command_hex;
CommandType type;
uint8_t address;
uint32_t serial;
uint32_t serial_number;
uint8_t length;
};
```
Expand Down

0 comments on commit ede6279

Please sign in to comment.