Add HA custom integration; fix bleak 3.x write-without-response regression

The OneControl panel's command characteristic is a streaming (Write Without
Response) endpoint. Bleak 3.x changed write_gatt_char to default to
write-with-response when the char advertises the "write" property, so every
command (incl. switch turn_on/off) got rejected by the panel with ATT 0x0E
(Unlikely Error), surfaced as BleakGATTProtocolError. Force response=False on
the command write (matching the auth key write) to restore control.

Also commits the productionized custom_components integration (config flow,
coordinator, switch/sensor/cover entities, key-seed TEA auth, COBS codec) and
the matching src/ RE client/COBS fixes (big-endian framing, table-driven CRC8,
status-event decoding) that were developed but never tracked.

Verified live on the campsite HAOS Pi: switch.exterior_lights / interior_lights
toggle the physical panel with no GATT error.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wes
2026-06-09 06:41:14 -04:00
co-authored by Claude Opus 4.8
parent b6d498c829
commit 34155fd7f9
14 changed files with 1207 additions and 129 deletions
@@ -0,0 +1,25 @@
DOMAIN = "lippert_onecontrol"
# DevID → friendly name
SWITCH_DEVICES = {
4: "Water Pump",
5: "Gas Water Heater",
6: "Exterior Lights",
7: "Interior Lights",
}
TANK_DEVICES = {
8: "Grey Tank 2",
9: "Grey Tank 1",
10: "Black Tank",
11: "Fresh Water Tank",
}
COVER_DEVICES = {
2: "Cover 2", # slide or awning — confirm physically before renaming
3: "Cover 3",
}
KEEPALIVE_INTERVAL = 20 # seconds between GetDevices keepalives
MAX_KEEPALIVE_FAILURES = 3 # consecutive failures before forcing reconnect
RECONNECT_DELAYS = [5, 10, 20, 60] # seconds, last value repeats