Update configuration and health check response structure in POE project. Modified config.py to replace IP addresses for Modbus hosts, ensuring accurate sensor location mapping. Refactored health_check.py to standardize response formatting for sensor data, enhancing clarity in health and sensor status reporting. Updated README.md to reflect changes in MQTT topic structure, aligning with new data point definitions for temperature, humidity, and CO2 sensors.

This commit is contained in:
Naab2k3
2025-06-24 09:03:10 +07:00
parent d171066bbd
commit 7b8934b1d0
3 changed files with 23 additions and 23 deletions

View File

@ -87,8 +87,8 @@ def read_and_publish_temperature_humidity(mqtt_client, modbus_client, host_info)
topics_data = [
(f"{base_topic}/Time", current_time),
(f"{base_topic}/Status", "online"),
(f"{base_topic}/Data/temperature", round(temperature, 1)),
(f"{base_topic}/Data/humidity", round(humidity, 1))
(f"{base_topic}/Temperature", round(temperature, 1)),
(f"{base_topic}/Humidity", round(humidity, 1))
]
all_published = True
@ -149,9 +149,9 @@ def read_and_publish_cwt_co2(mqtt_client, modbus_client, host_info):
topics_data = [
(f"{base_topic}/Time", current_time),
(f"{base_topic}/Status", "online"),
(f"{base_topic}/Data/temperature", round(temperature, 1)),
(f"{base_topic}/Data/humidity", round(humidity, 1)),
(f"{base_topic}/Data/co2", co2_ppm)
(f"{base_topic}/Temperature", round(temperature, 1)),
(f"{base_topic}/Humidity", round(humidity, 1)),
(f"{base_topic}/CO2", co2_ppm)
]
all_published = True