Skip to content

Commit

Permalink
Change available compressors (openviess#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyfx1 authored Oct 7, 2021
1 parent 23572b0 commit 8803d7b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion PyViCare/PyViCareHeatPump.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def getCompressor(self, compressor):

@handleNotSupported
def getAvailableCompressors(self):
return self.service.getProperty("heating.compressors")["components"]
return self.service.getProperty("heating.compressors")["properties"]["enabled"]["value"]

@handleNotSupported
def getBufferMainTemperature(self):
Expand Down
3 changes: 3 additions & 0 deletions tests/test_Vitocal200.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def test_getCompressorActive(self):
def test_getCompressorHours(self):
self.assertAlmostEqual(
self.device.compressors[0].getHours(), 8583.2)

def test_getAvailableCompressors(self):
self.assertEqual(self.device.getAvailableCompressors(), ['0'])

def test_getCompressorStarts(self):
self.assertAlmostEqual(
Expand Down
3 changes: 3 additions & 0 deletions tests/test_Vitocal200S.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ def test_getDomesticHotWaterConfiguredTemperature(self):
self.assertEqual(
self.device.getDomesticHotWaterConfiguredTemperature(), 40)

def test_getAvailableCompressors(self):
self.assertEqual(self.device.getAvailableCompressors(), ['0'])

def test_getDomesticHotWaterConfiguredTemperature2(self):
self.assertEqual(
self.device.getDomesticHotWaterConfiguredTemperature2(), 60)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_Vitocaldens222F.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_getAvailableBurners(self):
self.assertEqual(self.device.getAvailableBurners(), ['0'])

def test_getAvailableCompressors(self):
self.assertEqual(self.device.getAvailableCompressors(), ['0', '1'])
self.assertEqual(self.device.getAvailableCompressors(), ['0'])

def test_getActive(self):
self.assertEqual(self.device.burners[0].getActive(), False)
Expand Down

0 comments on commit 8803d7b

Please sign in to comment.