Example #1
0
    def setUp(self):
        """Set up test variables."""
        vals = {'name': 'Ecobee',
                'program': {'climates': [{'name': 'Climate1',
                                          'climateRef': 'c1'},
                                         {'name': 'Climate2',
                                          'climateRef': 'c2'}],
                            'currentClimateRef': 'c1'},
                'runtime': {'actualTemperature': 300,
                            'actualHumidity': 15,
                            'desiredHeat': 400,
                            'desiredCool': 200,
                            'desiredFanMode': 'on'},
                'settings': {'hvacMode': 'auto',
                             'fanMinOnTime': 10,
                             'heatCoolMinDelta': 50,
                             'holdAction': 'nextTransition'},
                'equipmentStatus': 'fan',
                'events': [{'name': 'Event1',
                            'running': True,
                            'type': 'hold',
                            'holdClimateRef': 'away',
                            'endDate': '2017-01-01 10:00:00',
                            'startDate': '2017-02-02 11:00:00'}]}

        self.ecobee = mock.Mock()
        self.ecobee.__getitem__ = mock.Mock(side_effect=vals.__getitem__)
        self.ecobee.__setitem__ = mock.Mock(side_effect=vals.__setitem__)

        self.data = mock.Mock()
        self.data.ecobee.get_thermostat.return_value = self.ecobee
        self.thermostat = ecobee.Thermostat(self.data, 1, False)
Example #2
0
    def setUp(self):
        """Set up test variables."""
        vals = {
            "name":
            "Ecobee",
            "program": {
                "climates": [
                    {
                        "name": "Climate1",
                        "climateRef": "c1"
                    },
                    {
                        "name": "Climate2",
                        "climateRef": "c2"
                    },
                ],
                "currentClimateRef":
                "c1",
            },
            "runtime": {
                "actualTemperature": 300,
                "actualHumidity": 15,
                "desiredHeat": 400,
                "desiredCool": 200,
                "desiredFanMode": "on",
            },
            "settings": {
                "hvacMode": "auto",
                "heatStages": 1,
                "coolStages": 1,
                "fanMinOnTime": 10,
                "heatCoolMinDelta": 50,
                "holdAction": "nextTransition",
            },
            "equipmentStatus":
            "fan",
            "events": [{
                "name": "Event1",
                "running": True,
                "type": "hold",
                "holdClimateRef": "away",
                "endDate": "2017-01-01 10:00:00",
                "startDate": "2017-02-02 11:00:00",
            }],
        }

        self.ecobee = mock.Mock()
        self.ecobee.__getitem__ = mock.Mock(side_effect=vals.__getitem__)
        self.ecobee.__setitem__ = mock.Mock(side_effect=vals.__setitem__)

        self.data = mock.Mock()
        self.data.ecobee.get_thermostat.return_value = self.ecobee
        self.thermostat = ecobee.Thermostat(self.data, 1)
Example #3
0
def thermostat_fixture(data):
    """Set up ecobee thermostat object."""
    return ecobee.Thermostat(data, 1)
Example #4
0
def thermostat_fixture(data):
    """Set up ecobee thermostat object."""
    thermostat = data.ecobee.get_thermostat(1)
    return ecobee.Thermostat(data, 1, thermostat)