summaryrefslogtreecommitdiff
path: root/src/inverter_mqtt_sender.py
blob: 327077b0031fce1f0d4ffb65cc063c6776f52058 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python3
from home.config import config
from home.mqtt import MqttWrapper, MqttNode


if __name__ == '__main__':
    config.load('inverter_mqtt_sender')

    mqtt = MqttWrapper()
    node = MqttNode(node_id='inverter')
    node.load_module('inverter',
                     status_poll_freq=int(config['mqtt']['inverter']['poll_freq']),
                     generation_poll_freq=int(config['mqtt']['inverter']['generation_poll_freq']))
    mqtt.add_node(node)

    mqtt.connect_and_loop()