Throw an error when invalid device_mode is given (#13739)

* Throw an error when invalid device_mode is given

* Fix lint issue, typo and error msg

* Fix error msg
This commit is contained in:
dangyuluo 2018-04-07 15:47:56 -04:00 committed by Fabian Affolter
parent 435b49fb96
commit 6cd599b7df

View File

@ -187,6 +187,11 @@ class NestThermostat(ClimateDevice):
device_mode = operation_mode
elif operation_mode == STATE_AUTO:
device_mode = NEST_MODE_HEAT_COOL
else:
device_mode = STATE_OFF
_LOGGER.error(
"An error occurred while setting device mode. "
"Invalid operation mode: %s", operation_mode)
self.device.mode = device_mode
@property