Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions esphome/components/ct002/ct002.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ bool CT002Component::validate_ct_mac_(const std::vector<std::string> &fields) co
if (this->ct_mac_.empty()) return true;
if (fields.size() < 4) return false;
std::string req(fields[3]);
if (req.empty() || req == "000000000000") return true;
for (auto &c : req) c = static_cast<char>(std::tolower(c));
std::string cfg(this->ct_mac_);
for (auto &c : cfg) c = static_cast<char>(std::tolower(c));
Expand Down
2 changes: 2 additions & 0 deletions src/astrameter/ct002/ct002.py
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,8 @@ def _ct_mac_matches(self, request: CT002Request) -> bool:
"""Whether *request* names the CT MAC we are configured to answer for."""
if not self.ct_mac:
return True
if request.ct_mac in ("", "000000000000"):
return True
return bool(request.ct_mac) and request.ct_mac.lower() == self.ct_mac.lower()

async def _safe_handle_request(
Expand Down
Loading