parent
aade4e63b8
commit
e307e1315a
1 changed files with 8 additions and 0 deletions
|
@ -30,11 +30,13 @@ class ChargerSwitch(TeslaDevice, SwitchEntity):
|
|||
"""Send the on command."""
|
||||
_LOGGER.debug("Enable charging: %s", self.name)
|
||||
await self.tesla_device.start_charge()
|
||||
self.async_write_ha_state()
|
||||
|
||||
async def async_turn_off(self, **kwargs):
|
||||
"""Send the off command."""
|
||||
_LOGGER.debug("Disable charging for: %s", self.name)
|
||||
await self.tesla_device.stop_charge()
|
||||
self.async_write_ha_state()
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
|
@ -51,11 +53,13 @@ class RangeSwitch(TeslaDevice, SwitchEntity):
|
|||
"""Send the on command."""
|
||||
_LOGGER.debug("Enable max range charging: %s", self.name)
|
||||
await self.tesla_device.set_max()
|
||||
self.async_write_ha_state()
|
||||
|
||||
async def async_turn_off(self, **kwargs):
|
||||
"""Send the off command."""
|
||||
_LOGGER.debug("Disable max range charging: %s", self.name)
|
||||
await self.tesla_device.set_standard()
|
||||
self.async_write_ha_state()
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
|
@ -87,11 +91,13 @@ class UpdateSwitch(TeslaDevice, SwitchEntity):
|
|||
"""Send the on command."""
|
||||
_LOGGER.debug("Enable updates: %s %s", self.name, self.tesla_device.id())
|
||||
self.controller.set_updates(self.tesla_device.id(), True)
|
||||
self.async_write_ha_state()
|
||||
|
||||
async def async_turn_off(self, **kwargs):
|
||||
"""Send the off command."""
|
||||
_LOGGER.debug("Disable updates: %s %s", self.name, self.tesla_device.id())
|
||||
self.controller.set_updates(self.tesla_device.id(), False)
|
||||
self.async_write_ha_state()
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
|
@ -108,11 +114,13 @@ class SentryModeSwitch(TeslaDevice, SwitchEntity):
|
|||
"""Send the on command."""
|
||||
_LOGGER.debug("Enable sentry mode: %s", self.name)
|
||||
await self.tesla_device.enable_sentry_mode()
|
||||
self.async_write_ha_state()
|
||||
|
||||
async def async_turn_off(self, **kwargs):
|
||||
"""Send the off command."""
|
||||
_LOGGER.debug("Disable sentry mode: %s", self.name)
|
||||
await self.tesla_device.disable_sentry_mode()
|
||||
self.async_write_ha_state()
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue