HA entity, sensor and device classes (iteration 2, step 3)

HaEntity describes an entity for device-based discovery, throttles its
state (SEN-14) and reports availability (SEN-15); HaSensor is the
`sensor` type. HaDevice publishes discovery, availability and states
after each connect and after HA's birth message, provides the last
will and removes itself from HA. Unit tests with a fake MQTT client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 16:12:43 +02:00
co-authored by Claude Opus 5.5
parent 96df60e6bd
commit 466743eff9
13 changed files with 862 additions and 4 deletions
+8
View File
@@ -41,6 +41,14 @@ qt_add_executable(tst_config tst_config.cpp)
target_link_libraries(tst_config PRIVATE frameassistant_lib Qt6::Test)
add_test(NAME config COMMAND tst_config)
# HA entities and the HA device (D23, D31, D32); the device with a fake MQTT client.
qt_add_executable(tst_haentity tst_haentity.cpp)
target_link_libraries(tst_haentity PRIVATE frameassistant_lib Qt6::Test)
add_test(NAME haentity COMMAND tst_haentity)
qt_add_executable(tst_hadevice tst_hadevice.cpp FakeMqttClient.h)
target_link_libraries(tst_hadevice PRIVATE frameassistant_lib Qt6::Test)
add_test(NAME hadevice COMMAND tst_hadevice)
# MosquittoClient against a local mosquitto broker (D30 level 2); skips without one.
qt_add_executable(tst_mqtt tst_mqtt.cpp)
target_link_libraries(tst_mqtt PRIVATE frameassistant_lib Qt6::Test)