Ejemplo n.º 1
0
class Vitocal200S(unittest.TestCase):
    def setUp(self):
        self.service = ViCareServiceMock('response/Vitocal200S.json')
        self.device = HeatPump(self.service)

    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)

    def test_getReturnTemperature(self):
        self.assertEqual(self.device.getReturnTemperature(), 27.9)

    def test_getSupplyTemperaturePrimaryCircuit(self):
        self.assertEqual(self.device.getSupplyTemperaturePrimaryCircuit(),
                         14.5)

    def test_getReturnTemperatureSecondaryCircuit(self):
        self.assertEqual(self.device.getReturnTemperatureSecondaryCircuit(),
                         27.9)
Ejemplo n.º 2
0
class Vitocal300G(unittest.TestCase):
    def setUp(self):
        self.service = ViCareServiceMock('response/Vitocal300G.json')
        self.device = HeatPump(self.service)

    def test_getCompressorActive(self):
        self.assertEqual(self.device.compressors[0].getActive(), False)

    def test_getCompressorHours(self):
        self.assertAlmostEqual(self.device.compressors[0].getHours(), 1762.41)

    def test_getCompressorStarts(self):
        self.assertAlmostEqual(self.device.compressors[0].getStarts(), 3012)

    def test_getCompressorHoursLoadClass1(self):
        self.assertAlmostEqual(self.device.compressors[0].getHoursLoadClass1(),
                               30)

    def test_getCompressorHoursLoadClass2(self):
        self.assertAlmostEqual(self.device.compressors[0].getHoursLoadClass2(),
                               703)

    def test_getCompressorHoursLoadClass3(self):
        self.assertAlmostEqual(self.device.compressors[0].getHoursLoadClass3(),
                               878)

    def test_getCompressorHoursLoadClass4(self):
        self.assertAlmostEqual(self.device.compressors[0].getHoursLoadClass4(),
                               117)

    def test_getCompressorHoursLoadClass5(self):
        self.assertAlmostEqual(self.device.compressors[0].getHoursLoadClass5(),
                               20)

    def test_getHeatingCurveSlope(self):
        self.assertAlmostEqual(self.device.circuits[0].getHeatingCurveSlope(),
                               0.8)

    def test_getHeatingCurveShift(self):
        self.assertAlmostEqual(self.device.circuits[0].getHeatingCurveShift(),
                               -5)

    def test_getReturnTemperature(self):
        self.assertAlmostEqual(self.device.getReturnTemperature(), 18.9)

    def test_getReturnTemperaturePrimaryCircuit(self):
        self.assertAlmostEqual(
            self.device.getReturnTemperaturePrimaryCircuit(), 18.4)

    def test_getSupplyTemperaturePrimaryCircuit(self):
        self.assertAlmostEqual(
            self.device.getSupplyTemperaturePrimaryCircuit(), 18.2)

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

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

    def test_getDomesticHotWaterCirculationPumpActive(self):
        self.assertEqual(
            self.device.getDomesticHotWaterCirculationPumpActive(), False)
Ejemplo n.º 3
0
class Vitocal200(unittest.TestCase):
    def setUp(self):
        self.service = ViCareServiceMock('response/Vitocal200.json')
        self.device = HeatPump(self.service)

    def test_getCompressorActive(self):
        self.assertEqual(self.device.compressors[0].getActive(), False)

    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(self.device.compressors[0].getStarts(), 3180)

    def test_getCompressorHoursLoadClass1(self):
        self.assertAlmostEqual(self.device.compressors[0].getHoursLoadClass1(),
                               227)

    def test_getCompressorHoursLoadClass2(self):
        self.assertAlmostEqual(self.device.compressors[0].getHoursLoadClass2(),
                               3294)

    def test_getCompressorHoursLoadClass3(self):
        self.assertAlmostEqual(self.device.compressors[0].getHoursLoadClass3(),
                               3903)

    def test_getCompressorHoursLoadClass4(self):
        self.assertAlmostEqual(self.device.compressors[0].getHoursLoadClass4(),
                               506)

    def test_getCompressorHoursLoadClass5(self):
        self.assertAlmostEqual(self.device.compressors[0].getHoursLoadClass5(),
                               461)

    def test_getHeatingCurveSlope(self):
        self.assertAlmostEqual(self.device.circuits[0].getHeatingCurveSlope(),
                               0.3)

    def test_getHeatingCurveShift(self):
        self.assertAlmostEqual(self.device.circuits[0].getHeatingCurveShift(),
                               -5)

    def test_getReturnTemperature(self):
        self.assertAlmostEqual(self.device.getReturnTemperature(), 27.5)

    def test_getReturnTemperaturePrimaryCircuit(self):
        self.assertRaises(PyViCareNotSupportedFeatureError,
                          self.device.getReturnTemperaturePrimaryCircuit)

    def test_getSupplyTemperaturePrimaryCircuit(self):
        self.assertAlmostEqual(
            self.device.getSupplyTemperaturePrimaryCircuit(), 18.9)

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

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

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

    def test_getDomesticHotWaterActiveMode_fri_10_10_time(self):
        with now_is('2021-09-10 10:10:00'):
            self.assertEqual(self.device.getDomesticHotWaterActiveMode(),
                             'temp-2')

    def test_getDomesticHotWaterDesiredTemperature_fri_10_10_time(self):
        with now_is('2021-09-10 10:10:00'):
            self.assertEqual(
                self.device.getDomesticHotWaterDesiredTemperature(), 60)

    def test_getDomesticHotWaterDesiredTemperature_fri_20_00_time(self):
        with now_is('2021-09-10 20:00:00'):
            self.assertEqual(
                self.device.getDomesticHotWaterDesiredTemperature(), 50)