mirror of
https://github.com/alexhopeoconnor/SunGather.git
synced 2026-10-04 02:48:12 +10:00
change default client id to include the inverter model
This commit is contained in:
@@ -11,11 +11,12 @@ class export_mqtt(object):
|
||||
|
||||
# Configure MQTT
|
||||
def configure(self, config, inverter):
|
||||
model = inverter.getInverterModel(True)
|
||||
self.mqtt_config = {
|
||||
'host': config.get('host', None),
|
||||
'port': config.get('port', 1883),
|
||||
'client_id': config.get('client_id', 'SunGather'),
|
||||
'topic': config.get('topic', "inverter/{model}/registers").replace('{model}', inverter.getInverterModel(True)),
|
||||
'client_id': config.get('client_id', f'SunGather-{model}'),
|
||||
'topic': config.get('topic', f"inverter/{model}/registers"),
|
||||
'username': config.get('username', None),
|
||||
'password': config.get('password',None),
|
||||
'homeassistant': config.get('homeassistant',False)
|
||||
|
||||
Reference in New Issue
Block a user