def setup_method(self, method): """Test the setup method.""" def fake_temperatures(force_refresh=None): """Create fake temperatures.""" temps = [ { "id": "1", "temp": 20, "setpoint": 21, "thermostat": "main", "name": "House", }, { "id": "2", "temp": 21, "setpoint": 22, "thermostat": "DOMESTIC_HOT_WATER", }, ] return temps self.device = mock.MagicMock() self.device.temperatures.side_effect = fake_temperatures self.round1 = honeywell.RoundThermostat(self.device, "1", True, 16) self.round1.update() self.round2 = honeywell.RoundThermostat(self.device, "2", False, 17) self.round2.update()
def setup_method(self, method): """Test the setup method.""" def fake_temperatures(force_refresh=None): """Create fake temperatures.""" temps = [ { 'id': '1', 'temp': 20, 'setpoint': 21, 'thermostat': 'main', 'name': 'House' }, { 'id': '2', 'temp': 21, 'setpoint': 22, 'thermostat': 'DOMESTIC_HOT_WATER' }, ] return temps self.device = mock.MagicMock() self.device.temperatures.side_effect = fake_temperatures self.round1 = honeywell.RoundThermostat(self.device, '1', True, 16) self.round1.update() self.round2 = honeywell.RoundThermostat(self.device, '2', False, 17) self.round2.update()