my-PV added german translation

pull/1/head
Boernsman 2020-06-18 10:38:10 +02:00
parent 4d7031f810
commit dc9f6ca8e9
3 changed files with 332 additions and 19 deletions

View File

@ -41,6 +41,7 @@ IntegrationPluginMyPv::IntegrationPluginMyPv()
void IntegrationPluginMyPv::discoverThings(ThingDiscoveryInfo *info)
{
if (info->thingClassId() == elwaThingClassId) {
QUdpSocket *searchSocket = new QUdpSocket(this);
// Note: This will fail, and it's not a problem, but it is required to force the socket to stick to IPv4...
@ -56,7 +57,7 @@ void IntegrationPluginMyPv::discoverThings(ThingDiscoveryInfo *info)
qint64 len = searchSocket->writeDatagram(discoveryString, QHostAddress("255.255.255.255"), 16124);
if (len != discoveryString.length()) {
searchSocket->deleteLater();
qCWarning(dcMypv()) << "Error sending discovery";
info->finish(Thing::ThingErrorHardwareNotAvailable , tr("Error starting device discovery"));
return;
}
@ -87,33 +88,30 @@ void IntegrationPluginMyPv::discoverThings(ThingDiscoveryInfo *info)
continue;
}
quint32 uiAddress = 0;
for (int i=0; i<4; i++) {
uiAddress |= data.at(7-i) << (i*8);
}
QHostAddress address(uiAddress);
ThingDescriptor thingDescriptors(info->thingClassId(), "AC ELWA-E", senderAddress.toString());
QByteArray serialNumber = data.mid(8, 16);
bool existing = false;
foreach (Thing *existingThing, myThings()) {
if (existingThing->thingClassId() == info->thingClassId() && existingThing->paramValue(elwaThingIpAddressParamTypeId).toString() == address.toString()) {
existing = true;
if (serialNumber == existingThing->paramValue(elwaThingSerialNumberParamTypeId).toString()) {
qCDebug(dcMypv()) << "Rediscovered device " << existingThing->name();
thingDescriptors.setThingId(existingThing->id());
break;
}
}
if (existing) {
qCDebug(dcMypv()) << "Already have device" << senderAddress << "in configured devices. Skipping...";
continue;
}
ThingDescriptor thingDescriptors(info->thingClassId(), "AC ELWA-E", address.toString());
ParamList params;
params << Param(elwaThingIpAddressParamTypeId, address.toString());
params << Param(elwaThingIpAddressParamTypeId, senderAddress.toString());
params << Param(elwaThingSerialNumberParamTypeId, serialNumber);
thingDescriptors.setParams(params);
descriptorList << thingDescriptors;
}
info->addThingDescriptors(descriptorList);;
searchSocket->deleteLater();
info->finish(Thing::ThingErrorNoError);
});
} else {
Q_ASSERT_X(false, "discoverThings", QString("Unhandled thingClassId: %1").arg(info->thingClassId().toString()).toUtf8());
}
}
void IntegrationPluginMyPv::setupThing(ThingSetupInfo *info)
@ -130,7 +128,7 @@ void IntegrationPluginMyPv::setupThing(ThingSetupInfo *info)
m_modbusTcpMasters.insert(thing, modbusTcpMaster);
} else {
Q_ASSERT_X(false, "setupDevice", QString("Unhandled deviceClassId: %1").arg(thing->thingClassId().toString()).toUtf8());
Q_ASSERT_X(false, "setupThing", QString("Unhandled thingClassId: %1").arg(thing->thingClassId().toString()).toUtf8());
}
}
@ -159,14 +157,23 @@ void IntegrationPluginMyPv::executeAction(ThingActionInfo *info)
ModbusTCPMaster *modbusTCPMaster = m_modbusTcpMasters.value(thing);
if (action.actionTypeId() == elwaHeatingPowerActionTypeId) {
int heatingPower = action.param(elwaHeatingPowerActionHeatingPowerParamTypeId).value().toInt();
QUuid requestId = modbusTCPMaster->writeHoldingRegister(0xff, ElwaModbusRegisters::Power, heatingPower);
m_asyncActions.insert(requestId, info);
if (requestId.isNull()) {
info->finish(Thing::ThingErrorHardwareNotAvailable);
} else {
m_asyncActions.insert(requestId, info);
connect(info, &ThingActionInfo::aborted, this, [this, requestId] {m_asyncActions.remove(requestId);});
}
} else if (action.actionTypeId() == elwaPowerActionTypeId) {
bool power = action.param(elwaHeatingPowerActionHeatingPowerParamTypeId).value().toBool();
if(power) {
QUuid requestId = modbusTCPMaster->writeHoldingRegister(0xff, ElwaModbusRegisters::ManuelStart, 1);
m_asyncActions.insert(requestId, info);
if (requestId.isNull()) {
info->finish(Thing::ThingErrorHardwareNotAvailable);
} else {
m_asyncActions.insert(requestId, info);
connect(info, &ThingActionInfo::aborted, this, [this, requestId] {m_asyncActions.remove(requestId);});
}
}
} else {
Q_ASSERT_X(false, "executeAction", QString("Unhandled actionTypeId: %1").arg(action.actionTypeId().toString()).toUtf8());

View File

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de">
<context>
<name>IntegrationPluginMyPv</name>
<message>
<location filename="../integrationpluginmypv.cpp" line="60"/>
<source>Error starting device discovery</source>
<translation>Fehler beim starten der Gerätesuche</translation>
</message>
</context>
<context>
<name>Mypv</name>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="47"/>
<source>AC Elwa E</source>
<extracomment>The name of the ThingClass ({19ac4c7c-9c0a-4998-a8f0-c77d940cbb08})</extracomment>
<translation>AC Elwa E</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="50"/>
<source>Change power</source>
<extracomment>The name of the ActionType ({e6b0260b-f255-4f17-8ac1-bc87a950f449}) of ThingClass elwa</extracomment>
<translation>Ändere Eingeschalten</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="53"/>
<source>Change power consumption</source>
<extracomment>The name of the ActionType ({2eb3c40c-1b43-4b64-82e2-6558f0b8817e}) of ThingClass elwa</extracomment>
<translation>Ändere Leistungsverbrauch</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="56"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="59"/>
<source>Connected</source>
<extracomment>The name of the ParamType (ThingClass: elwa, EventType: connected, ID: {a5afaad5-78bf-4cac-b98d-7eae31aac518})
----------
The name of the StateType ({a5afaad5-78bf-4cac-b98d-7eae31aac518}) of ThingClass elwa</extracomment>
<translation>Verbunden</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="62"/>
<source>Connected changed</source>
<extracomment>The name of the EventType ({a5afaad5-78bf-4cac-b98d-7eae31aac518}) of ThingClass elwa</extracomment>
<translation>Verbunden geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="65"/>
<source>IP address</source>
<extracomment>The name of the ParamType (ThingClass: elwa, Type: thing, ID: {ae66596f-f6c7-4d9c-9eee-b9190616a9e1})</extracomment>
<translation>IP-Adresse</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="68"/>
<source>Mypv</source>
<extracomment>The name of the plugin Mypv ({73c7efcc-80d5-4166-ad97-2cbbeb129d91})</extracomment>
<translation>my-PV</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="71"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="74"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="77"/>
<source>Power</source>
<extracomment>The name of the ParamType (ThingClass: elwa, ActionType: power, ID: {e6b0260b-f255-4f17-8ac1-bc87a950f449})
----------
The name of the ParamType (ThingClass: elwa, EventType: power, ID: {e6b0260b-f255-4f17-8ac1-bc87a950f449})
----------
The name of the StateType ({e6b0260b-f255-4f17-8ac1-bc87a950f449}) of ThingClass elwa</extracomment>
<translation>Eingeschalten</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="80"/>
<source>Power changed</source>
<extracomment>The name of the EventType ({e6b0260b-f255-4f17-8ac1-bc87a950f449}) of ThingClass elwa</extracomment>
<translation>Leistung geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="83"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="86"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="89"/>
<source>Power consumption</source>
<extracomment>The name of the ParamType (ThingClass: elwa, ActionType: heatingPower, ID: {2eb3c40c-1b43-4b64-82e2-6558f0b8817e})
----------
The name of the ParamType (ThingClass: elwa, EventType: heatingPower, ID: {2eb3c40c-1b43-4b64-82e2-6558f0b8817e})
----------
The name of the StateType ({2eb3c40c-1b43-4b64-82e2-6558f0b8817e}) of ThingClass elwa</extracomment>
<translation>Leistung</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="92"/>
<source>Power consumption changed</source>
<extracomment>The name of the EventType ({2eb3c40c-1b43-4b64-82e2-6558f0b8817e}) of ThingClass elwa</extracomment>
<translation>Leistung geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="95"/>
<source>Serial number</source>
<extracomment>The name of the ParamType (ThingClass: elwa, Type: thing, ID: {b31a263a-2fdc-4a88-88ec-9e182025da8f})</extracomment>
<translation>Seriennummer</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="98"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="101"/>
<source>Status</source>
<extracomment>The name of the ParamType (ThingClass: elwa, EventType: status, ID: {d0a7065e-7773-47d7-b474-ce8d21d55aa7})
----------
The name of the StateType ({d0a7065e-7773-47d7-b474-ce8d21d55aa7}) of ThingClass elwa</extracomment>
<translation>Status</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="104"/>
<source>Status changed</source>
<extracomment>The name of the EventType ({d0a7065e-7773-47d7-b474-ce8d21d55aa7}) of ThingClass elwa</extracomment>
<translation>Status geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="107"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="110"/>
<source>Target water temperature</source>
<extracomment>The name of the ParamType (ThingClass: elwa, EventType: targetWaterTemperature, ID: {2b089c93-6411-41f7-96aa-f78d5cf910cb})
----------
The name of the StateType ({2b089c93-6411-41f7-96aa-f78d5cf910cb}) of ThingClass elwa</extracomment>
<translation>Zielwassertemperatur</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="113"/>
<source>Target water temperature changed</source>
<extracomment>The name of the EventType ({2b089c93-6411-41f7-96aa-f78d5cf910cb}) of ThingClass elwa</extracomment>
<translation>Zielwassertemperatur geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="116"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="119"/>
<source>Water temperature</source>
<extracomment>The name of the ParamType (ThingClass: elwa, EventType: temperature, ID: {60006f93-8852-433b-bbc0-f10cc3939eeb})
----------
The name of the StateType ({60006f93-8852-433b-bbc0-f10cc3939eeb}) of ThingClass elwa</extracomment>
<translation>Wassertemperatur</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="122"/>
<source>Water temperature changed</source>
<extracomment>The name of the EventType ({60006f93-8852-433b-bbc0-f10cc3939eeb}) of ThingClass elwa</extracomment>
<translation>Wassertemperatur geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="125"/>
<source>my-PV</source>
<extracomment>The name of the vendor ({1f17597f-e0d0-459b-858d-ec9cbcd10b2c})</extracomment>
<translation>my-PV</translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>IntegrationPluginMyPv</name>
<message>
<location filename="../integrationpluginmypv.cpp" line="60"/>
<source>Error starting device discovery</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Mypv</name>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="47"/>
<source>AC Elwa E</source>
<extracomment>The name of the ThingClass ({19ac4c7c-9c0a-4998-a8f0-c77d940cbb08})</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="50"/>
<source>Change power</source>
<extracomment>The name of the ActionType ({e6b0260b-f255-4f17-8ac1-bc87a950f449}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="53"/>
<source>Change power consumption</source>
<extracomment>The name of the ActionType ({2eb3c40c-1b43-4b64-82e2-6558f0b8817e}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="56"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="59"/>
<source>Connected</source>
<extracomment>The name of the ParamType (ThingClass: elwa, EventType: connected, ID: {a5afaad5-78bf-4cac-b98d-7eae31aac518})
----------
The name of the StateType ({a5afaad5-78bf-4cac-b98d-7eae31aac518}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="62"/>
<source>Connected changed</source>
<extracomment>The name of the EventType ({a5afaad5-78bf-4cac-b98d-7eae31aac518}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="65"/>
<source>IP address</source>
<extracomment>The name of the ParamType (ThingClass: elwa, Type: thing, ID: {ae66596f-f6c7-4d9c-9eee-b9190616a9e1})</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="68"/>
<source>Mypv</source>
<extracomment>The name of the plugin Mypv ({73c7efcc-80d5-4166-ad97-2cbbeb129d91})</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="71"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="74"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="77"/>
<source>Power</source>
<extracomment>The name of the ParamType (ThingClass: elwa, ActionType: power, ID: {e6b0260b-f255-4f17-8ac1-bc87a950f449})
----------
The name of the ParamType (ThingClass: elwa, EventType: power, ID: {e6b0260b-f255-4f17-8ac1-bc87a950f449})
----------
The name of the StateType ({e6b0260b-f255-4f17-8ac1-bc87a950f449}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="80"/>
<source>Power changed</source>
<extracomment>The name of the EventType ({e6b0260b-f255-4f17-8ac1-bc87a950f449}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="83"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="86"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="89"/>
<source>Power consumption</source>
<extracomment>The name of the ParamType (ThingClass: elwa, ActionType: heatingPower, ID: {2eb3c40c-1b43-4b64-82e2-6558f0b8817e})
----------
The name of the ParamType (ThingClass: elwa, EventType: heatingPower, ID: {2eb3c40c-1b43-4b64-82e2-6558f0b8817e})
----------
The name of the StateType ({2eb3c40c-1b43-4b64-82e2-6558f0b8817e}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="92"/>
<source>Power consumption changed</source>
<extracomment>The name of the EventType ({2eb3c40c-1b43-4b64-82e2-6558f0b8817e}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="95"/>
<source>Serial number</source>
<extracomment>The name of the ParamType (ThingClass: elwa, Type: thing, ID: {b31a263a-2fdc-4a88-88ec-9e182025da8f})</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="98"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="101"/>
<source>Status</source>
<extracomment>The name of the ParamType (ThingClass: elwa, EventType: status, ID: {d0a7065e-7773-47d7-b474-ce8d21d55aa7})
----------
The name of the StateType ({d0a7065e-7773-47d7-b474-ce8d21d55aa7}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="104"/>
<source>Status changed</source>
<extracomment>The name of the EventType ({d0a7065e-7773-47d7-b474-ce8d21d55aa7}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="107"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="110"/>
<source>Target water temperature</source>
<extracomment>The name of the ParamType (ThingClass: elwa, EventType: targetWaterTemperature, ID: {2b089c93-6411-41f7-96aa-f78d5cf910cb})
----------
The name of the StateType ({2b089c93-6411-41f7-96aa-f78d5cf910cb}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="113"/>
<source>Target water temperature changed</source>
<extracomment>The name of the EventType ({2b089c93-6411-41f7-96aa-f78d5cf910cb}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="116"/>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="119"/>
<source>Water temperature</source>
<extracomment>The name of the ParamType (ThingClass: elwa, EventType: temperature, ID: {60006f93-8852-433b-bbc0-f10cc3939eeb})
----------
The name of the StateType ({60006f93-8852-433b-bbc0-f10cc3939eeb}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="122"/>
<source>Water temperature changed</source>
<extracomment>The name of the EventType ({60006f93-8852-433b-bbc0-f10cc3939eeb}) of ThingClass elwa</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-modbus-Desktop-Debug/mypv/plugininfo.h" line="125"/>
<source>my-PV</source>
<extracomment>The name of the vendor ({1f17597f-e0d0-459b-858d-ec9cbcd10b2c})</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
</TS>