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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user