diff --git a/libnymea/interfaces/battery.json b/libnymea/interfaces/battery.json index 43399cfe..05eeb387 100644 --- a/libnymea/interfaces/battery.json +++ b/libnymea/interfaces/battery.json @@ -20,13 +20,9 @@ "optional": true }, { - "name": "charging", - "type": "bool", - "optional": true - }, - { - "name": "discharging", - "type": "bool", + "name": "chargingState", + "type": "QString", + "allowdValues": ["idle", "charging", "discharging"], "optional": true } ] diff --git a/libnymea/interfaces/energystorage.json b/libnymea/interfaces/energystorage.json new file mode 100644 index 00000000..866024d5 --- /dev/null +++ b/libnymea/interfaces/energystorage.json @@ -0,0 +1,12 @@ +{ + "description": "Interfaces for devices that store electrical energy and can return it at a later point, such as batteries. The currentPower state follows the usual convention that positive is 'consumed' energy and negative values represent 'produced' or in this case 'returned' energy.", + "extends": ["battery", "smartmeter"], + "states": [ + { + "name": "currentPower", + "type": "double", + "unit": "Watt", + "logged": true + } + ] +} diff --git a/libnymea/interfaces/interfaces.qrc b/libnymea/interfaces/interfaces.qrc index d2996531..3d6ee2ca 100644 --- a/libnymea/interfaces/interfaces.qrc +++ b/libnymea/interfaces/interfaces.qrc @@ -88,5 +88,6 @@ cleaningrobot.json airquality.json indoorairquality.json + energystorage.json