mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
parent
3f623ad453
commit
20c43df768
@ -2,7 +2,6 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.switch import SwitchEntity
|
from homeassistant.components.switch import SwitchEntity
|
||||||
from homeassistant.const import STATE_ON
|
|
||||||
|
|
||||||
from . import DOMAIN as TESLA_DOMAIN, TeslaDevice
|
from . import DOMAIN as TESLA_DOMAIN, TeslaDevice
|
||||||
|
|
||||||
@ -42,7 +41,7 @@ class ChargerSwitch(TeslaDevice, SwitchEntity):
|
|||||||
"""Get whether the switch is in on state."""
|
"""Get whether the switch is in on state."""
|
||||||
if self.tesla_device.is_charging() is None:
|
if self.tesla_device.is_charging() is None:
|
||||||
return None
|
return None
|
||||||
return self.tesla_device.is_charging() == STATE_ON
|
return self.tesla_device.is_charging()
|
||||||
|
|
||||||
|
|
||||||
class RangeSwitch(TeslaDevice, SwitchEntity):
|
class RangeSwitch(TeslaDevice, SwitchEntity):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user