From 395a75766d9cfad2607b3afc82c40fa5b218e3a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Wed, 10 Sep 2025 12:55:46 +0200 Subject: [PATCH] Fix init after setup --- everest/integrationplugineverest.cpp | 7 ++----- everest/jsonrpc/everestevse.cpp | 11 ++++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/everest/integrationplugineverest.cpp b/everest/integrationplugineverest.cpp index 9d2e325b..08cc37f8 100644 --- a/everest/integrationplugineverest.cpp +++ b/everest/integrationplugineverest.cpp @@ -50,9 +50,9 @@ void IntegrationPluginEverest::init() QFileInfo enableMqttFileInfo(NymeaSettings::settingsPath() + "/everest-mqtt"); m_useMqtt = enableMqttFileInfo.exists(); if (m_useMqtt) { - qCDebug(dcEverest()) << "MQTT API module enabled, detected" << enableMqttFileInfo.absoluteFilePath(); + qCDebug(dcEverest()) << "MQTT API module autodetection enabled, found enable file" << enableMqttFileInfo.absoluteFilePath(); } else { - qCDebug(dcEverest()) << "MQTT API module disabled, the file" << enableMqttFileInfo.absoluteFilePath() << "does not exist."; + qCDebug(dcEverest()) << "MQTT API module autodetection disabled, the enable file" << enableMqttFileInfo.absoluteFilePath() << "does not exist."; } } @@ -210,9 +210,6 @@ void IntegrationPluginEverest::discoverThings(ThingDiscoveryInfo *info) mqttDiscovery->start(); return; } - } else { - info->finish(Thing::ThingErrorUnsupportedFeature); - return; } if (info->thingClassId() == everestConnectionThingClassId) { diff --git a/everest/jsonrpc/everestevse.cpp b/everest/jsonrpc/everestevse.cpp index ebefa24b..15973c58 100644 --- a/everest/jsonrpc/everestevse.cpp +++ b/everest/jsonrpc/everestevse.cpp @@ -51,7 +51,7 @@ EverestEvse::EverestEvse(EverestJsonRpcClient *client, Thing *thing, QObject *pa connect(m_client, &EverestJsonRpcClient::evseStatusChanged, this, [this](int evseIndex, const EverestJsonRpcClient::EVSEStatus &evseStatus){ // We are only insterested in our own status - if (m_index != evseIndex) + if (m_index != evseIndex || !m_initialized) return; m_evseStatus = evseStatus; @@ -60,7 +60,7 @@ EverestEvse::EverestEvse(EverestJsonRpcClient *client, Thing *thing, QObject *pa connect(m_client, &EverestJsonRpcClient::hardwareCapabilitiesChanged, this, [this](int evseIndex, const EverestJsonRpcClient::HardwareCapabilities &hardwareCapabilities){ // We are only insterested in our own status - if (m_index != evseIndex) + if (m_index != evseIndex || !m_initialized) return; m_hardwareCapabilities = hardwareCapabilities; @@ -69,16 +69,17 @@ EverestEvse::EverestEvse(EverestJsonRpcClient *client, Thing *thing, QObject *pa connect(m_client, &EverestJsonRpcClient::meterDataChanged, this, [this](int evseIndex, const EverestJsonRpcClient::MeterData &meterData){ // We are only insterested in our own status - if (m_index != evseIndex) + if (m_index != evseIndex || !m_initialized) return; m_meterData = meterData; processMeterData(); }); - if (m_client->available()) + if (m_client->available()) { qCDebug(dcEverest()) << "Evse: The connection is already available. Initializing the instance..."; - + initialize(); + } } int EverestEvse::index() const