From 20c43df7687f5dda12dac3d156f932ceaf5d0049 Mon Sep 17 00:00:00 2001 From: Alan Tse Date: Fri, 23 Oct 2020 04:17:10 -0700 Subject: [PATCH] Fix is_on test for Tesla Charger switch (#42251) closes #41755 --- homeassistant/components/tesla/switch.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/tesla/switch.py b/homeassistant/components/tesla/switch.py index cb57c1e3d5c..9fcdbae0c1c 100644 --- a/homeassistant/components/tesla/switch.py +++ b/homeassistant/components/tesla/switch.py @@ -2,7 +2,6 @@ import logging from homeassistant.components.switch import SwitchEntity -from homeassistant.const import STATE_ON from . import DOMAIN as TESLA_DOMAIN, TeslaDevice @@ -42,7 +41,7 @@ class ChargerSwitch(TeslaDevice, SwitchEntity): """Get whether the switch is in on state.""" if self.tesla_device.is_charging() is None: return None - return self.tesla_device.is_charging() == STATE_ON + return self.tesla_device.is_charging() class RangeSwitch(TeslaDevice, SwitchEntity):