mirror of https://github.com/nymea/nymea.git
Rework battery interface
parent
96ae3cd01a
commit
d46ef1c5fa
|
|
@ -4,6 +4,30 @@
|
|||
"name": "batteryCritical",
|
||||
"type": "bool",
|
||||
"logged": true
|
||||
},
|
||||
{
|
||||
"name": "batteryLevel",
|
||||
"type": "int",
|
||||
"minValue": 0,
|
||||
"maxValue": 100,
|
||||
"unit": "Percentage",
|
||||
"optional": true,
|
||||
"logged": true
|
||||
},
|
||||
{
|
||||
"name": "pluggedIn",
|
||||
"type": "bool",
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"name": "charging",
|
||||
"type": "bool",
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"name": "discharging",
|
||||
"type": "bool",
|
||||
"optional": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"extends": "battery",
|
||||
"states": [
|
||||
{
|
||||
"name": "batteryLevel",
|
||||
"type": "int",
|
||||
"minValue": 0,
|
||||
"maxValue": 100,
|
||||
"unit": "Percentage"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -24,7 +24,6 @@
|
|||
<file>mediametadataprovider.json</file>
|
||||
<file>mediaplayer.json</file>
|
||||
<file>battery.json</file>
|
||||
<file>batterylevel.json</file>
|
||||
<file>button.json</file>
|
||||
<file>multibutton.json</file>
|
||||
<file>simplebutton.json</file>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
"id": "753f0d32-0468-4d08-82ed-1964aab03298",
|
||||
"name": "mock",
|
||||
"displayName": "Mock Thing",
|
||||
"interfaces": ["system", "light", "batterylevel", "wirelessconnectable", "update"],
|
||||
"interfaces": ["system", "light", "battery", "wirelessconnectable", "update"],
|
||||
"createMethods": ["user", "discovery"],
|
||||
"browsable": true,
|
||||
"discoveryParamTypes": [
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ void TestDevices::verifyInterfaces()
|
|||
QVERIFY(!mockDevice.isEmpty());
|
||||
|
||||
QVariantList interfaces = mockDevice.value("interfaces").toList();
|
||||
QVariantList expectedInterfaces = {"system", "light", "power", "batterylevel", "battery", "wirelessconnectable", "connectable", "update"};
|
||||
QVariantList expectedInterfaces = {"system", "light", "power", "battery", "wirelessconnectable", "connectable", "update"};
|
||||
qCDebug(dcTests()) << interfaces;
|
||||
qCDebug(dcTests()) << expectedInterfaces;
|
||||
QCOMPARE(interfaces, expectedInterfaces);
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ void TestIntegrations::verifyInterfaces()
|
|||
QVERIFY(!mock.isEmpty());
|
||||
|
||||
QVariantList interfaces = mock.value("interfaces").toList();
|
||||
QVariantList expectedInterfaces = {"system", "light", "power", "batterylevel", "battery", "wirelessconnectable", "connectable", "update"};
|
||||
QVariantList expectedInterfaces = {"system", "light", "power", "battery", "wirelessconnectable", "connectable", "update"};
|
||||
qCDebug(dcTests()) << interfaces;
|
||||
qCDebug(dcTests()) << expectedInterfaces;
|
||||
QCOMPARE(interfaces, expectedInterfaces);
|
||||
|
|
|
|||
Loading…
Reference in New Issue