Rework battery interface
This commit is contained in:
parent
96ae3cd01a
commit
d46ef1c5fa
@ -4,6 +4,30 @@
|
|||||||
"name": "batteryCritical",
|
"name": "batteryCritical",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"logged": true
|
"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>mediametadataprovider.json</file>
|
||||||
<file>mediaplayer.json</file>
|
<file>mediaplayer.json</file>
|
||||||
<file>battery.json</file>
|
<file>battery.json</file>
|
||||||
<file>batterylevel.json</file>
|
|
||||||
<file>button.json</file>
|
<file>button.json</file>
|
||||||
<file>multibutton.json</file>
|
<file>multibutton.json</file>
|
||||||
<file>simplebutton.json</file>
|
<file>simplebutton.json</file>
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
"id": "753f0d32-0468-4d08-82ed-1964aab03298",
|
"id": "753f0d32-0468-4d08-82ed-1964aab03298",
|
||||||
"name": "mock",
|
"name": "mock",
|
||||||
"displayName": "Mock Thing",
|
"displayName": "Mock Thing",
|
||||||
"interfaces": ["system", "light", "batterylevel", "wirelessconnectable", "update"],
|
"interfaces": ["system", "light", "battery", "wirelessconnectable", "update"],
|
||||||
"createMethods": ["user", "discovery"],
|
"createMethods": ["user", "discovery"],
|
||||||
"browsable": true,
|
"browsable": true,
|
||||||
"discoveryParamTypes": [
|
"discoveryParamTypes": [
|
||||||
|
|||||||
@ -327,7 +327,7 @@ void TestDevices::verifyInterfaces()
|
|||||||
QVERIFY(!mockDevice.isEmpty());
|
QVERIFY(!mockDevice.isEmpty());
|
||||||
|
|
||||||
QVariantList interfaces = mockDevice.value("interfaces").toList();
|
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()) << interfaces;
|
||||||
qCDebug(dcTests()) << expectedInterfaces;
|
qCDebug(dcTests()) << expectedInterfaces;
|
||||||
QCOMPARE(interfaces, expectedInterfaces);
|
QCOMPARE(interfaces, expectedInterfaces);
|
||||||
|
|||||||
@ -339,7 +339,7 @@ void TestIntegrations::verifyInterfaces()
|
|||||||
QVERIFY(!mock.isEmpty());
|
QVERIFY(!mock.isEmpty());
|
||||||
|
|
||||||
QVariantList interfaces = mock.value("interfaces").toList();
|
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()) << interfaces;
|
||||||
qCDebug(dcTests()) << expectedInterfaces;
|
qCDebug(dcTests()) << expectedInterfaces;
|
||||||
QCOMPARE(interfaces, expectedInterfaces);
|
QCOMPARE(interfaces, expectedInterfaces);
|
||||||
|
|||||||
Reference in New Issue
Block a user