Add tests for vera component (#28340)

* Adding tests for vera component.
Fixing update bug in the vera climate platform.

* Updating requrements file.

* Moving vera stop to a job.
Sorting imports.

* Addressing simple PR feedback.

* Splitting tests into platforms.

* Mocking controller instead of using requests_mock.

* Updating pyvera to use version that stops threads quickly.

* Updating requirements files.

* Mocking the pyvera module, not the API.

* Addressing PR feedback.
Handling start/stop of patch in fixture.
Removing unecessary code.

* Using generator
This commit is contained in:
Robert Van Gorkom
2019-12-09 00:19:38 +01:00
committed by Martin Hjelmare
parent 076e0273a2
commit e577f047f7
17 changed files with 831 additions and 3 deletions
+6
View File
@@ -92,6 +92,8 @@ class VeraThermostat(VeraDevice, ClimateDevice):
else:
self.vera_device.fan_auto()
self.schedule_update_ha_state()
@property
def current_power_w(self):
"""Return the current power usage in W."""
@@ -129,6 +131,8 @@ class VeraThermostat(VeraDevice, ClimateDevice):
if kwargs.get(ATTR_TEMPERATURE) is not None:
self.vera_device.set_temperature(kwargs.get(ATTR_TEMPERATURE))
self.schedule_update_ha_state()
def set_hvac_mode(self, hvac_mode):
"""Set new target hvac mode."""
if hvac_mode == HVAC_MODE_OFF:
@@ -139,3 +143,5 @@ class VeraThermostat(VeraDevice, ClimateDevice):
self.vera_device.turn_cool_on()
elif hvac_mode == HVAC_MODE_HEAT:
self.vera_device.turn_heat_on()
self.schedule_update_ha_state()
+1 -1
View File
@@ -3,7 +3,7 @@
"name": "Vera",
"documentation": "https://www.home-assistant.io/integrations/vera",
"requirements": [
"pyvera==0.3.6"
"pyvera==0.3.7"
],
"dependencies": [],
"codeowners": []