Skip to content

Commit

Permalink
chore(testdata): Update trv data (openviess#416)
Browse files Browse the repository at this point in the history
* Update zigbee_zk03840.json

* Update zigbee_zk03840.json

* Rename zigbee_zk03840.json to zigbee_zk03840_trv.json

* Update test_zigbee_zk03840.py

* Update test_zigbee_zk03840.py
  • Loading branch information
CFenner authored Oct 2, 2024
1 parent 1d71359 commit 889af90
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 64 deletions.
61 changes: 0 additions & 61 deletions tests/response/zigbee_zk03840.json

This file was deleted.

112 changes: 112 additions & 0 deletions tests/response/zigbee_zk03840_trv.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
6 changes: 3 additions & 3 deletions tests/test_zigbee_zk03840.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 889af90

Please sign in to comment.