Fix solar edge initial connected state

pull/39/head
Simon Stürz 2021-11-19 16:11:48 +01:00
parent edaa75f531
commit f4ae5912f7
1 changed files with 2 additions and 1 deletions

View File

@ -98,7 +98,6 @@ void IntegrationPluginSunSpec::init()
m_connectedStateTypeIds.insert(sunspecSinglePhaseMeterThingClassId, sunspecSinglePhaseMeterConnectedStateTypeId);
m_connectedStateTypeIds.insert(sunspecSplitPhaseMeterThingClassId, sunspecSplitPhaseMeterConnectedStateTypeId);
m_connectedStateTypeIds.insert(sunspecThreePhaseMeterThingClassId, sunspecThreePhaseMeterConnectedStateTypeId);
m_connectedStateTypeIds.insert(solarEdgeBatteryThingClassId, solarEdgeBatteryConnectedStateTypeId);
// Params for sunspec things
m_modelIdParamTypeIds.insert(sunspecSinglePhaseInverterThingClassId, sunspecSinglePhaseInverterThingModelIdParamTypeId);
@ -690,6 +689,8 @@ void IntegrationPluginSunSpec::setupSolarEdgeBattery(ThingSetupInfo *info)
m_sunSpecThings.insert(thing, battery);
connect(battery, &SolarEdgeBattery::blockDataUpdated, this, &IntegrationPluginSunSpec::onSolarEdgeBatteryBlockUpdated);
info->finish(Thing::ThingErrorNoError);
// Set up successfully, init done, we are connected for sure
thing->setSettingValue(solarEdgeBatteryConnectedStateTypeId, true);
});
// Start initializing battery data