Skip to content

Commit

Permalink
Initial test for Vitodens333F (openviess#141)
Browse files Browse the repository at this point in the history
* Adding Vitodens 300W data and test

* Adding tests for NotSupportedFeatureError, but leaving commented out desired outcome as Viessmann should support these as they used too

* Last update for vitodens300W for now - take it or leave it:-)

* Merged

* Adding description and changes to make it easier to extract test datasets for others

* Adding tests for Vitodens333F and renamed response file
  • Loading branch information
jborup authored Aug 4, 2021
1 parent 5fbe2f4 commit 07f8c6d
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
File renamed without changes.
64 changes: 64 additions & 0 deletions tests/test_Vitodens333F.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import unittest
from tests.ViCareServiceMock import ViCareServiceMock
from PyViCare.PyViCareGazBoiler import GazBoiler
from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError


class Vitodens333F(unittest.TestCase):
def setUp(self):
self.service = ViCareServiceMock('response/Vitodens333F.json')
self.device = GazBoiler(self.service)

def test_getBurnerActive(self):
self.assertEqual(self.device.getBurnerActive(), False)

def test_getBurnerStarts(self):
self.assertEqual(self.device.circuits[0].getBurnerStarts(), 13987)

def test_getBurnerHours(self):
self.assertEqual(self.device.circuits[0].getBurnerHours(), 14071.8)

def test_getBurnerModulation(self):
self.assertEqual(self.device.circuits[0].getBurnerModulation(), 0)

def test_getPrograms(self):
expected_programs = ['active', 'comfort', 'eco',
'external', 'holiday', 'normal', 'reduced', 'standby']
self.assertListEqual(
self.device.circuits[0].getPrograms(), expected_programs)

def test_getModes(self):
expected_modes = ['standby', 'dhw', 'dhwAndHeating',
'forcedReduced', 'forcedNormal']
self.assertListEqual(
self.device.circuits[0].getModes(), expected_modes)

def test_getPowerConsumptionDays(self):
expected_consumption = [0.097, 0.162, 0.166,
0.162, 0.159, 0.173, 0.182, 0.159]
self.assertEqual(self.device.getPowerConsumptionDays(),
expected_consumption)

def test_getFrostProtectionActive(self):
self.assertEqual(
self.device.circuits[0].getFrostProtectionActive(), False)

def test_getDomesticHotWaterCirculationPumpActive(self):
self.assertEqual(
self.device.getDomesticHotWaterCirculationPumpActive(), False)

def test_getDomesticHotWaterOutletTemperature(self):
self.assertEqual(
self.device.getDomesticHotWaterOutletTemperature(), 29.8)

def test_getDomesticHotWaterCirculationSchedule(self):
self.assertEqual(
self.device.getDomesticHotWaterCirculationSchedule(), ['on'])

def test_getOutsideTemperature(self):
self.assertEqual(
self.device.getOutsideTemperature(), 26.2)

def test_getBoilerTemperature(self):
self.assertEqual(
self.device.getBoilerTemperature(), 35)

0 comments on commit 07f8c6d

Please sign in to comment.