generate_ha: on/off lighting becomes a light; brightness-only "lights" go to review instead of invalid YAML

Found on a real 1312-GA house, measured on all seven corpus projects.

B. Lighting on/off (1.001, lighting category) is emitted as a Home Assistant light with
   address + state_address, not a switch. The HA KNX light platform documents exactly
   that ("Simple light"). suggest.py already proposed light for these; the two engines
   disagreed. Without status it is reported as light_without_status.

D. A 5.001 lighting GA with no on/off GA in its zone produced a light with only
   brightness_address. Home Assistant requires address on a KNX light, so that YAML was
   invalid. 51 of them across six projects, mostly motion-detector parameters on 5.001.
   They now go to review as light_without_switch, and the brightness status is no longer
   consumed for an entity that does not exist, so it surfaces as not_mapped.

Corpus, before -> after: lights without address 51 -> 0 everywhere; no address lost from
YAML or review on any project; switch -> light moves of 220 (house), 205, 62, 43, 17, 10,
13. test_pipeline B1 fixture gains its on/off GAs (it encoded an invalid light) plus a
test for the review route. CHANGELOG also records fix A from 481bab0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Nikolay Miroshnichenko
2026-09-16 18:32:42 +02:00
co-authored by Claude Opus 5
parent 481bab0e0c
commit cb226a008f
5 changed files with 100 additions and 28 deletions
+22
View File
@@ -6,6 +6,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Fixed
- **Home Assistant lights without `address` are no longer generated.** A 5.001 lighting GA with no
on/off GA in its zone used to become a light with only `brightness_address`, which Home Assistant
rejects (`address` is required on a KNX light). On six real projects 51 such lights were generated,
mostly motion-detector parameters on 5.001 ("sensitivity", "daytime command"). They now go to the
review list as `light_without_switch`; no address is dropped silently.
- **`subdpt_suspect` false positives.** A 1-bit, date/time or text GA named after a quantity
("on by motion detector by illuminance", "CO2 threshold", "meter value recorded, date") is a flag or
timestamp, not the value, and is no longer checked (12 of 12 such hits in the corpus were false).
Legitimate DPTs of the same quantity are accepted: power 9.024 and 14.080, energy 13.010 to 13.016
and 14.031, and power factor has its own rule (14.057). Checked against xknx 3.20. On a real
1312-GA house: 17 findings -> 2.
### Changed
- **On/off lighting is generated as a Home Assistant `light`, not a `switch`.** The KNX light platform
takes a plain on/off light with `address` + `state_address`, and light entities are what Assist and
"all lights" act on. Lighting without a status GA is reported as `light_without_status`. Regenerated
packages move these entities from `switch:` to `light:` (220 on a real house); review before replacing
a deployed package.
## [0.8.2] - 2026-09-14
### Added