temphum_mqtt_node: use correct data topic

This commit is contained in:
Evgeny Zinoviev 2024-02-24 02:03:28 +03:00
parent c9b351a08e
commit 9be0c3125d

View File

@ -9,7 +9,7 @@ from typing import Optional
from argparse import ArgumentParser from argparse import ArgumentParser
from homekit.config import config from homekit.config import config
from homekit.mqtt import MqttNodesConfig, MqttNode, MqttWrapper from homekit.mqtt import MqttNodesConfig, MqttNode, MqttWrapper
from homekit.mqtt.module.temphum import MqttTempHumModule, MqttTemphumDataPayload from homekit.mqtt.module.temphum import MqttTempHumModule, MqttTemphumDataPayload, DATA_TOPIC
from homekit.temphum import SensorType, BaseSensor from homekit.temphum import SensorType, BaseSensor
from homekit.temphum.i2c import create_sensor from homekit.temphum.i2c import create_sensor
@ -53,7 +53,7 @@ async def on_sched_task():
rh, temp = await get_measurements() rh, temp = await get_measurements()
payload = MqttTemphumDataPayload(temp=temp, rh=rh) payload = MqttTemphumDataPayload(temp=temp, rh=rh)
_mqtt_node.publish('data', payload.pack()) _mqtt_node.publish(DATA_TOPIC, payload.pack())
if __name__ == '__main__': if __name__ == '__main__':