diff --git a/tests/response/zigbee_zk03840.json b/tests/response/zigbee_zk03840.json deleted file mode 100644 index 2eeb3b49..00000000 --- a/tests/response/zigbee_zk03840.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "data": [ - { - "apiVersion": 1, - "commands": {}, - "deviceId": "zigbee-84fd27fffed5a072", - "feature": "device.sensors.temperature", - "gatewayId": "################", - "isEnabled": true, - "isReady": true, - "properties": { - "status": { - "type": "string", - "value": "connected" - }, - "value": { - "type": "number", - "unit": "celsius", - "value": 18.5 - } - }, - "timestamp": "2023-01-05T21:57:01.580Z", - "uri": "https://api.viessmann.com/iot/v1/equipment/installations/#######/gateways/################/devices/zigbee-84fd27fffed5a072/features/device.sensors.temperature" - }, - { - "apiVersion": 1, - "commands": { - "setTargetTemperature": { - "isExecutable": false, - "name": "setTargetTemperature", - "params": { - "temperature": { - "constraints": { - "max": 30, - "min": 8, - "stepping": 0.5 - }, - "required": true, - "type": "number" - } - }, - "uri": "https://api.viessmann.com/iot/v1/equipment/installations/#######/gateways/################/devices/zigbee-84fd27fffed5a072/features/trv.temperature/commands/setTargetTemperature" - } - }, - "deviceId": "zigbee-84fd27fffed5a072", - "feature": "trv.temperature", - "gatewayId": "################", - "isEnabled": true, - "isReady": true, - "properties": { - "value": { - "type": "number", - "unit": "celsius", - "value": 18 - } - }, - "timestamp": "2023-01-05T03:59:37.716Z", - "uri": "https://api.viessmann.com/iot/v1/equipment/installations/#######/gateways/################/devices/zigbee-84fd27fffed5a072/features/trv.temperature" - } - ] -} diff --git a/tests/response/zigbee_zk03840_trv.json b/tests/response/zigbee_zk03840_trv.json new file mode 100644 index 00000000..0b31eaa3 --- /dev/null +++ b/tests/response/zigbee_zk03840_trv.json @@ -0,0 +1,112 @@ +{ + "data": [ + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-048727fffe196e03", + "feature": "device.messages.errors.raw", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "entries": { + "type": "array", + "value": [] + } + }, + "timestamp": "2024-10-01T00:31:25.906Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-048727fffe196e03/features/device.messages.errors.raw" + }, + { + "apiVersion": 1, + "commands": { + "setName": { + "isExecutable": true, + "name": "setName", + "params": { + "name": { + "constraints": { + "maxLength": 40, + "minLength": 1, + "regEx": "^[\\p{L}0-9]+( [\\p{L}0-9]+)*$" + }, + "required": true, + "type": "string" + } + }, + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-048727fffe196e03/features/device.name/commands/setName" + } + }, + "deviceId": "zigbee-048727fffe196e03", + "feature": "device.name", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "name": { + "type": "string", + "value": "" + } + }, + "timestamp": "2024-10-01T00:31:25.906Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-048727fffe196e03/features/device.name" + }, + { + "apiVersion": 1, + "commands": {}, + "deviceId": "zigbee-048727fffe196e03", + "feature": "device.sensors.temperature", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "status": { + "type": "string", + "value": "connected" + }, + "value": { + "type": "number", + "unit": "celsius", + "value": 18.4 + } + }, + "timestamp": "2024-10-01T15:31:33.915Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-048727fffe196e03/features/device.sensors.temperature" + }, + { + "apiVersion": 1, + "commands": { + "setTargetTemperature": { + "isExecutable": false, + "name": "setTargetTemperature", + "params": { + "temperature": { + "constraints": { + "max": 30, + "min": 8, + "stepping": 0.5 + }, + "required": true, + "type": "number" + } + }, + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-048727fffe196e03/features/trv.temperature/commands/setTargetTemperature" + } + }, + "deviceId": "zigbee-048727fffe196e03", + "feature": "trv.temperature", + "gatewayId": "################", + "isEnabled": true, + "isReady": true, + "properties": { + "value": { + "type": "number", + "unit": "celsius", + "value": 8 + } + }, + "timestamp": "2024-10-01T08:44:50.292Z", + "uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/zigbee-048727fffe196e03/features/trv.temperature" + } + ] +} diff --git a/tests/test_zigbee_zk03840.py b/tests/test_zigbee_zk03840.py index fb7af3d2..3bc4ba24 100644 --- a/tests/test_zigbee_zk03840.py +++ b/tests/test_zigbee_zk03840.py @@ -6,16 +6,16 @@ class ZK03840(unittest.TestCase): def setUp(self): - self.service = ViCareServiceMock('response/zigbee_zk03840.json') + self.service = ViCareServiceMock('response/zigbee_zk03840_trv.json') self.device = RadiatorActuator(self.service) def test_getTemperature(self): self.assertEqual( - self.device.getTemperature(), 18.5) + self.device.getTemperature(), 18.4) def test_getTargetTemperature(self): self.assertEqual( - self.device.getTargetTemperature(), 18) + self.device.getTargetTemperature(), 8) def test_setTargetTemperature(self): self.device.setTargetTemperature(22)