mirror of
https://github.com/lumapu/ahoy.git
synced 2025-04-30 02:36:20 +02:00
RPI move function MQTT-Output as class method
RPI move function MQTT-Output as class method to outputs.py
This commit is contained in:
parent
52e8d98319
commit
dcfd966fe4
1 changed files with 5 additions and 2 deletions
|
@ -187,14 +187,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]))
|
command_queue[inv_str].append(hoymiles.compose_send_time_payload(InfoCommands.AlarmData, alarm_id=event_message_index[inv_str]))
|
||||||
|
|
||||||
if mqtt_client:
|
if mqtt_client:
|
||||||
mqtt_send_status(mqtt_client, inverter_ser, data,
|
# mqtt_send_status(mqtt_client, inverter_ser, data, topic=inverter.get('mqtt', {}).get('topic', None))
|
||||||
topic=inverter.get('mqtt', {}).get('topic', None))
|
mqtt_client.store_status(result, topic=inverter.get('mqtt', {}).get('topic', None))
|
||||||
|
|
||||||
if influx_client:
|
if influx_client:
|
||||||
influx_client.store_status(result)
|
influx_client.store_status(result)
|
||||||
|
|
||||||
if volkszaehler_client:
|
if volkszaehler_client:
|
||||||
volkszaehler_client.store_status(result)
|
volkszaehler_client.store_status(result)
|
||||||
|
|
||||||
|
"""
|
||||||
def mqtt_send_status(broker, inverter_ser, data, topic=None):
|
def mqtt_send_status(broker, inverter_ser, data, topic=None):
|
||||||
"""
|
"""
|
||||||
Publish StatusResponse object
|
Publish StatusResponse object
|
||||||
|
@ -238,6 +240,7 @@ def mqtt_send_status(broker, inverter_ser, data, topic=None):
|
||||||
broker.publish(f'{topic}/temperature', data['temperature'])
|
broker.publish(f'{topic}/temperature', data['temperature'])
|
||||||
if data['energy_total'] is not None:
|
if data['energy_total'] is not None:
|
||||||
broker.publish(f'{topic}/total', data['energy_total']/1000)
|
broker.publish(f'{topic}/total', data['energy_total']/1000)
|
||||||
|
"""
|
||||||
|
|
||||||
def mqtt_on_command(client, userdata, message):
|
def mqtt_on_command(client, userdata, message):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue