-
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.
feat: detect vitopure ventilation devices (#443)
* detect vitopure device as ventilation * add test cases
- Loading branch information
Showing
3 changed files
with
45 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
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,33 @@ | ||
import unittest | ||
|
||
from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError | ||
from PyViCare.PyViCareVentilationDevice import VentilationDevice | ||
from tests.ViCareServiceMock import ViCareServiceMock | ||
|
||
|
||
class Vitopure350(unittest.TestCase): | ||
def setUp(self): | ||
self.service = ViCareServiceMock('response/Vitopure350.json') | ||
self.device = VentilationDevice(self.service) | ||
|
||
def test_getActiveMode(self): | ||
self.assertEqual("sensorDriven", self.device.getActiveMode()) | ||
|
||
def test_getAvailableModes(self): | ||
expected_modes = ['permanent', 'ventilation', 'sensorDriven'] | ||
self.assertListEqual(expected_modes, self.device.getAvailableModes()) | ||
|
||
def test_getActiveProgram(self): | ||
self.assertEqual("automatic", self.device.getActiveProgram()) | ||
|
||
def test_getAvailablePrograms(self): | ||
expected_programs = ['standby'] | ||
self.assertListEqual(expected_programs, self.device.getAvailablePrograms()) | ||
|
||
def test_getSchedule(self): | ||
keys = ['active', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'] | ||
self.assertListEqual(keys, list(self.device.getSchedule().keys())) | ||
|
||
def test_getSerial(self): | ||
with self.assertRaises(PyViCareNotSupportedFeatureError): | ||
self.device.getSerial() |