From fc1fb0ab7cbe71137c79b6dfe6f58976bcecf8db Mon Sep 17 00:00:00 2001 From: springstan <46536646+springstan@users.noreply.github.com> Date: Sun, 13 Sep 2020 17:11:24 +0200 Subject: [PATCH] Revert 'Use STATE_UNKNOWN constant in dlink and ecobee' (#40022) --- homeassistant/components/dlink/switch.py | 5 ++--- homeassistant/components/ecobee/sensor.py | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/dlink/switch.py b/homeassistant/components/dlink/switch.py index 4fd21f200dd0..c173c879ad18 100644 --- a/homeassistant/components/dlink/switch.py +++ b/homeassistant/components/dlink/switch.py @@ -13,7 +13,6 @@ from homeassistant.const import ( CONF_NAME, CONF_PASSWORD, CONF_USERNAME, - STATE_UNKNOWN, TEMP_CELSIUS, ) import homeassistant.helpers.config_validation as cv @@ -146,14 +145,14 @@ class SmartPlugData: _LOGGER.warning("Waiting %s s to retry", retry_seconds) return - _state = STATE_UNKNOWN + _state = "unknown" try: self._last_tried = dt_util.now() _state = self.smartplug.state except urllib.error.HTTPError: _LOGGER.error("D-Link connection problem") - if _state == STATE_UNKNOWN: + if _state == "unknown": self._n_tried += 1 self.available = False _LOGGER.warning("Failed to connect to D-Link switch") diff --git a/homeassistant/components/ecobee/sensor.py b/homeassistant/components/ecobee/sensor.py index 4351b2305386..a3276c53e3ba 100644 --- a/homeassistant/components/ecobee/sensor.py +++ b/homeassistant/components/ecobee/sensor.py @@ -5,7 +5,6 @@ from homeassistant.const import ( DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, PERCENTAGE, - STATE_UNKNOWN, TEMP_FAHRENHEIT, ) from homeassistant.helpers.entity import Entity @@ -112,7 +111,7 @@ class EcobeeSensor(Entity): if self._state in [ ECOBEE_STATE_CALIBRATING, ECOBEE_STATE_UNKNOWN, - STATE_UNKNOWN, + "unknown", ]: return None