From 6cd599b7dfc8382b13325b350d17ecac4475bedb Mon Sep 17 00:00:00 2001 From: dangyuluo Date: Sat, 7 Apr 2018 15:47:56 -0400 Subject: [PATCH] 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 --- homeassistant/components/climate/nest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/components/climate/nest.py b/homeassistant/components/climate/nest.py index d11f6890a7b..0a5344fdf98 100644 --- a/homeassistant/components/climate/nest.py +++ b/homeassistant/components/climate/nest.py @@ -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