Sniffer: property record store, memory caps and text sensor rewrite

Open
#33 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp

Research direction

Start with the linked .specs/sniffer.md sections for property records, memory caps, text sensor, and configuration, then inspect sec_touch_sniffer.h and the hub frame buffer to check the specified limits. The issue names no test file; use the GoogleTest harness from #39 for the record store, history pool, text sensor builder, and config cases. Done means acceptance criteria 1–6 and 9 pass.

Written by the indexing model from the issue text.

Description

Spec: Property records, Memory caps, Text sensor, Configuration

  • Store: 256 slots indexed by ID (fields block ~6 KB + raw block 256 × 48 B), u32 uptime seconds, change and query status rules. IDs above 255 are dropped and counted.
  • History pool: 2 KB of variable-length previous values, depth 8 per ID, evicts from the ID with the most entries. Allocated only with web_page: true.
  • static_assert ties the 48 B raw cap to the hub's frame buffer.
  • Text sensor: id=raw for unregistered records with a raw value, 2048 cap with , …+N more, built in a heap string. Remove time/RTC use.
  • Config errors: non-ESP32 target, time_id, scan_end > 255. Add the web_page boolean (no effect yet).
  • Drop the stale memory comments in sec_touch_sniffer.h.

Done: acceptance criteria 1–6 and 9 in the spec.

Tests (harness from #39): host GoogleTest for the record store (change rules, failures, IDs above 255), the history pool (depth, eviction from the ID with the most entries) and the text sensor builder (selection, 2048 cap, marker). Config tests for non-ESP32, time_id and scan_end > 255.

Dominant language
C++
Stars
8
Forks
4
Avg merge
15h 58m
Merged PRs (30d)
5

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from distante/esphome-components

All issues in distante/esphome-components

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.