mirror of
https://github.com/lumapu/ahoy.git
synced 2025-08-01 15:38:25 +02:00
Merge pull request #579 from PaeserBastelstube/RPI-function-MQTT-Output-as-class-method
RPi function mqtt output as class method
This commit is contained in:
commit
0225481b29
2 changed files with 20 additions and 9 deletions
|
@ -176,14 +176,16 @@ def poll_inverter(inverter, dtu_ser, do_init, retries):
|
|||
command_queue[inv_str].append(hoymiles.compose_send_time_payload(InfoCommands.AlarmData, alarm_id=event_message_index[inv_str]))
|
||||
|
||||
if mqtt_client:
|
||||
mqtt_send_status(mqtt_client, inverter_ser, data,
|
||||
topic=inverter.get('mqtt', {}).get('topic', None))
|
||||
# mqtt_send_status(mqtt_client, inverter_ser, data, topic=inverter.get('mqtt', {}).get('topic', None))
|
||||
mqtt_client.store_status(result, topic=inverter.get('mqtt', {}).get('topic', None))
|
||||
|
||||
if influx_client:
|
||||
influx_client.store_status(result)
|
||||
|
||||
if volkszaehler_client:
|
||||
volkszaehler_client.store_status(result)
|
||||
|
||||
"""
|
||||
def mqtt_send_status(broker, inverter_ser, data, topic=None):
|
||||
"""
|
||||
Publish StatusResponse object
|
||||
|
@ -227,6 +229,7 @@ def mqtt_send_status(broker, inverter_ser, data, topic=None):
|
|||
broker.publish(f'{topic}/temperature', data['temperature'])
|
||||
if data['energy_total'] is not None:
|
||||
broker.publish(f'{topic}/total', data['energy_total']/1000)
|
||||
"""
|
||||
|
||||
def mqtt_on_command(client, userdata, message):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue