-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat: add Vitoconnect Opto 2 / Heatbox2 as gateway (#24) * add Vitoconnect Opto 2 / Heatbox2 as gateway * add AutoDetect test * update tests * Update PyViCareService.py remove empty lines * Fix Pylint issue with docstring * remove .pylintrc file Co-authored-by: Tobin Rosenau <[email protected]>
- Loading branch information
Showing
5 changed files
with
129 additions
and
8 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
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,97 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"feature": "gateway.devices", | ||
"gatewayId": "##############", | ||
"timestamp": "2024-03-28T05:06:02.633Z", | ||
"isEnabled": true, | ||
"isReady": true, | ||
"apiVersion": 1, | ||
"uri": "https://api.viessmann.com/iot/v1/features/installations/######/gateways/##############/features/gateway.devices", | ||
"properties": { | ||
"devices": { | ||
"type": "DeviceList", | ||
"value": [ | ||
{ | ||
"id": "gateway", | ||
"fingerprint": "###", | ||
"modelId": "Heatbox2_SRC", | ||
"modelVersion": "###", | ||
"name": "Heatbox 2 SRC, Vitoconnect", | ||
"type": "vitoconnect", | ||
"roles": [ | ||
"type:gateway;VitoconnectOpto2/OT2", | ||
"type:hb2", | ||
"type:legacy" | ||
], | ||
"status": "online" | ||
}, | ||
{ | ||
"id": "0", | ||
"fingerprint": "###", | ||
"modelId": "VPlusHO1_40", | ||
"modelVersion": "###", | ||
"name": "VT 200 (HO1A / HO1B)", | ||
"type": "heating", | ||
"roles": [ | ||
"type:boiler", | ||
"type:legacy", | ||
"type:product;VPlusHO1" | ||
], | ||
"status": "online" | ||
}, | ||
{ | ||
"id": "RoomControl-1", | ||
"fingerprint": "###", | ||
"modelId": "Smart_RoomControl", | ||
"modelVersion": "###", | ||
"name": "Smart_RoomControl_49", | ||
"type": "roomControl", | ||
"roles": [ | ||
"capability:monetization;FTDC", | ||
"capability:monetization;OWD", | ||
"capability:zigbeeCoordinator", | ||
"type:legacy", | ||
"type:virtual;smartRoomControl" | ||
], | ||
"status": "online" | ||
}, | ||
{ | ||
"id": "zigbee-#####", | ||
"fingerprint": "###", | ||
"modelId": "Smart_Device_eTRV_generic_50", | ||
"modelVersion": "ac746d50a111d3eb8fa54146c05971aa2bc5b5cc", | ||
"name": "Smart_Device_eTRV_generic_50", | ||
"type": "zigbee", | ||
"roles": [ | ||
"type:actuator", | ||
"type:legacy", | ||
"type:radiator", | ||
"type:smartRoomDevice" | ||
], | ||
"status": "online" | ||
} | ||
] | ||
} | ||
}, | ||
"commands": {} | ||
}, | ||
{ | ||
"feature": "gateway.wifi", | ||
"gatewayId": "##############", | ||
"timestamp": "2024-03-30T17:31:57.758Z", | ||
"isEnabled": true, | ||
"isReady": true, | ||
"apiVersion": 1, | ||
"uri": "https://api.viessmann.com/iot/v1/features/installations/######/gateways/##############/features/gateway.wifi", | ||
"properties": { | ||
"strength": { | ||
"type": "number", | ||
"value": -41, | ||
"unit": "" | ||
} | ||
}, | ||
"commands": {} | ||
} | ||
] | ||
} |
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,18 @@ | ||
import unittest | ||
|
||
from PyViCare.PyViCareGateway import Gateway | ||
from tests.ViCareServiceMock import ViCareServiceMock | ||
|
||
|
||
class VitoconnectOpto2(unittest.TestCase): | ||
def setUp(self): | ||
self.service = ViCareServiceMock('response/VitoconnectOpto2.json') | ||
self.device = Gateway(self.service) | ||
|
||
def test_getSerial(self): | ||
self.assertEqual( | ||
self.device.getSerial(), "##############") | ||
|
||
def test_getWifiSignalStrength(self): | ||
self.assertEqual( | ||
self.device.getWifiSignalStrength(), -41) |