Skip to content

Commit af5d280

Browse files
committed
chore(sec-touch): fix review comments
1 parent 38578c4 commit af5d280

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

.specs/sniffer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@ Note: discovered state is held in RAM only. After a device restart or firmware f
9999
2. Turning scan mode on stops normal polling and listener updates; the text sensor populates with discovered IDs across the configured range.
100100
3. Turning scan mode off mid-scan resumes normal polling immediately; the saved position is used when scan mode is turned on again.
101101
4. When scan mode runs to completion, polling resumes automatically and the binary sensor reflects the off state.
102-
5. IDs with registered listeners do not appear in passive capture output, but do appear in scan mode output.
102+
5. IDs with registered listeners do not appear in passive capture output and are skipped in scan mode, so they do not appear in scan output either.

components/sec_touch_sniffer/sec_touch_sniffer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ void SecTouchSniffer::toggle_scan() {
6060

6161
if (this->scan_end_ == 0) {
6262
ESP_LOGW(TAG, "toggle_scan() called but no scan range configured — ignoring");
63+
this->is_scanning_ = false;
64+
this->update_scan_switch_();
6365
return;
6466
}
6567

components/sec_touch_sniffer/sec_touch_sniffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct SniffedEntry {
1919
class SecTouchSniffer : public Component, public text_sensor::TextSensor {
2020
static constexpr const char *TAG = "SecTouchSniffer";
2121
// Text sensor payload cap: keeps output within comfortable MQTT/API packet sizes.
22-
// Each entry is ~35 chars; 255 chars fits ~7 entries before truncation.
22+
// Each entry is ~35 chars; 2048 chars fits ~58 entries before truncation.
2323
static constexpr size_t MAX_STATE_LEN = 2048;
2424

2525
public:

0 commit comments

Comments
 (0)