Skip to content

Commit

Permalink
add more programs to getPrograms (#339)
Browse files Browse the repository at this point in the history
* add more programs

* Remove 'active' from getPrograms

'active' is not program but it shows the current active operating program on the device

* Update test_getPrograms

add all programs for this device

* update getPrograms

correct alphabetical order of programs in getPrograms

* Update test_getPrograms for Vitocal200.py

remove 'active' from expected programs

* Update test_getPrograms for Vitocal300G.py

Remove 'active' from expected programs

* Update test_getPrograms for Vitocaldens222F.py

Remove 'active' from expected programs

* Update test_getPrograms for Vitodens200W.py

Remove 'active' from expected programs

* Update test_getPrograms for Vitodens200W_2.py

Remove 'active' from expected programs

* Update test_getPrograms for Vitodens222W.py

Remove 'active' from expected programs

* Update test_getPrograms for Vitodens300W.py

Remove 'active' from expected programs

* Update test_getPrograms for Vitodens333F.py

Remove 'active' from expected programs
  • Loading branch information
fb22 authored Nov 25, 2023
1 parent e988a38 commit da1ef0f
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 19 deletions.
7 changes: 5 additions & 2 deletions PyViCare/PyViCareHeatingDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,11 @@ def getActiveProgram(self):
@handleNotSupported
def getPrograms(self):
available_programs = []
for program in ['active', 'comfort', 'forcedLastFromSchedule', 'eco', 'external', 'fixed', 'holiday',
'normal', 'reduced', 'standby']:
for program in ['comfort', 'comfortCooling', 'comfortCoolingEnergySaving', 'comfortEnergySaving',
'comfortHeating', 'dhwPrecedence', 'eco', 'external', 'fixed', 'forcedLastFromSchedule',
'frostprotection', 'holiday', 'holidayAtHome', 'manual', 'normal', 'normalCooling',
'normalCoolingEnergySaving', 'normalEnergySaving', 'normalHeating', 'reduced', 'reducedCooling',
'reducedCoolingEnergySaving', 'reducedEnergySaving', 'reducedHeating', 'standby', 'summerEco']:
with suppress(PyViCareNotSupportedFeatureError):
if self.service.getProperty(
f"heating.circuits.{self.circuit}.operating.programs.{program}") is not None:
Expand Down
5 changes: 2 additions & 3 deletions tests/test_Vitocal200.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ def test_getSupplyTemperaturePrimaryCircuit(self):
self.device.getSupplyTemperaturePrimaryCircuit(), 11.6)

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

Expand Down Expand Up @@ -113,4 +112,4 @@ def test_getNormalProgramMaxTemperature(self):
self.assertEqual(self.device.getCircuit(0).getProgramMaxTemperature("normal"), 30)

Check warning on line 113 in tests/test_Vitocal200.py

View workflow job for this annotation

GitHub Actions / build (3.6)

W293 blank line contains whitespace
def test_getNormalProgramStepping(self):
self.assertEqual(self.device.getCircuit(0).getProgramStepping("normal"), 1)
self.assertEqual(self.device.getCircuit(0).getProgramStepping("normal"), 1)
2 changes: 1 addition & 1 deletion tests/test_Vitocal250A.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_getSupplyTemperaturePrimaryCircuit(self):
self.device.getSupplyTemperaturePrimaryCircuit(), 5.9)

def test_getPrograms(self):
expected_programs = ['active', 'forcedLastFromSchedule', 'fixed', 'standby']
expected_programs = ['comfortCooling', 'comfortCoolingEnergySaving', 'comfortEnergySaving', 'comfortHeating', 'fixed', 'forcedLastFromSchedule', 'frostprotection', 'normalCooling', 'normalCoolingEnergySaving', 'normalEnergySaving', 'normalHeating', 'reducedCooling', 'reducedCoolingEnergySaving', 'reducedEnergySaving', 'reducedHeating', 'standby', 'summerEco']
self.assertListEqual(
self.device.circuits[0].getPrograms(), expected_programs)

Expand Down
3 changes: 1 addition & 2 deletions tests/test_Vitocal300G.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ def test_getSupplyTemperaturePrimaryCircuit(self):
self.device.getSupplyTemperaturePrimaryCircuit(), 18.2)

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

Expand Down
3 changes: 1 addition & 2 deletions tests/test_Vitocaldens222F.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ def test_getCompressorHours(self):
self.assertEqual(self.device.getCompressor(0).getHours(), 1.4)

def test_getPrograms(self):
expected_programs = ['active', 'comfort', 'eco', 'fixed',
'normal', 'reduced', 'standby']
expected_programs = ['comfort', 'eco', 'fixed', 'normal', 'reduced', 'standby']
self.assertListEqual(
self.device.getCircuit(1).getPrograms(), expected_programs)

Expand Down
3 changes: 1 addition & 2 deletions tests/test_Vitodens200W.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def test_getBurnerModulation(self):
self.assertEqual(self.device.burners[0].getModulation(), 0)

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

Expand Down
3 changes: 1 addition & 2 deletions tests/test_Vitodens200W_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ def test_getBurnerModulation(self):
self.assertEqual(self.device.burners[0].getModulation(), 0)

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

Expand Down
2 changes: 1 addition & 1 deletion tests/test_Vitodens222W.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_getBurnerModulation(self):
self.assertEqual(self.device.burners[0].getModulation(), 15.8)

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

Expand Down
3 changes: 1 addition & 2 deletions tests/test_Vitodens300W.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ def test_getBurnerModulation(self):
self.assertEqual(self.device.burners[0].getModulation(), 0)

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

Expand Down
3 changes: 1 addition & 2 deletions tests/test_Vitodens333F.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ def test_getBurnerModulation(self):
self.assertEqual(self.device.burners[0].getModulation(), 0)

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

Expand Down

0 comments on commit da1ef0f

Please sign in to comment.