-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update PyViCareDevice.py * Create device_error.json * Create test_device_error.py * Update PyViCareDevice.py * Update test_device_error.py * Update PyViCareDevice.py * Rename tests/response/device_error.json to tests/response/deviceerrors/F.1100.json * Update test_device_error.py
- Loading branch information
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"apiVersion": 1, | ||
"commands": {}, | ||
"deviceId": "0", | ||
"feature": "device.messages.errors.raw", | ||
"gatewayId": "################", | ||
"isEnabled": true, | ||
"isReady": true, | ||
"properties": { | ||
"entries": { | ||
"type": "array", | ||
"value": [ | ||
{ | ||
"accessLevel": "customer", | ||
"audiences": [ | ||
"IS-SUPPLIER", | ||
"IS-DEVELOPMENT", | ||
"IS-MANUFACTURING", | ||
"IS-AFTERSALES", | ||
"IS-AFTERMARKET", | ||
"IS-DEVELOPER-VEG", | ||
"IS-BIG-DATA", | ||
"IS-MANUFACTURING-VEG" | ||
], | ||
"errorCode": "F.1100", | ||
"priority": "criticalError", | ||
"timestamp": "2000-07-22T20:37:44.000Z" | ||
} | ||
] | ||
} | ||
}, | ||
"timestamp": "2024-10-30T08:53:23.913Z", | ||
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/device.messages.errors.raw" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import unittest | ||
|
||
from PyViCare.PyViCareDevice import Device | ||
from tests.ViCareServiceMock import ViCareServiceMock | ||
|
||
|
||
class DeviceErrorTest(unittest.TestCase): | ||
def setUp(self): | ||
self.service = ViCareServiceMock('response/deviceerrors/F.1100.json') | ||
self.device = Device(self.service) | ||
|
||
def test_deviceErrors(self): | ||
errors = self.device.getDeviceErrors() | ||
self.assertEqual(len(errors), 1) | ||
self.assertEqual(errors[0]["errorCode"], "F.1100") | ||
self.assertEqual(errors[0]["priority"], "criticalError") |