From 8803d7b815a4aa544b04d0e2ed0f8e8f66016909 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 7 Oct 2021 18:45:22 +0200 Subject: [PATCH] Change available compressors (#213) --- PyViCare/PyViCareHeatPump.py | 2 +- tests/test_Vitocal200.py | 3 +++ tests/test_Vitocal200S.py | 3 +++ tests/test_Vitocaldens222F.py | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/PyViCare/PyViCareHeatPump.py b/PyViCare/PyViCareHeatPump.py index 7d104108..e289f001 100644 --- a/PyViCare/PyViCareHeatPump.py +++ b/PyViCare/PyViCareHeatPump.py @@ -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): diff --git a/tests/test_Vitocal200.py b/tests/test_Vitocal200.py index 876e63d2..c172bb7c 100644 --- a/tests/test_Vitocal200.py +++ b/tests/test_Vitocal200.py @@ -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( diff --git a/tests/test_Vitocal200S.py b/tests/test_Vitocal200S.py index 79898fda..cb8dd6b8 100644 --- a/tests/test_Vitocal200S.py +++ b/tests/test_Vitocal200S.py @@ -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) diff --git a/tests/test_Vitocaldens222F.py b/tests/test_Vitocaldens222F.py index 67161ee4..5dc0d568 100644 --- a/tests/test_Vitocaldens222F.py +++ b/tests/test_Vitocaldens222F.py @@ -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)