From 40ff15fb713120d57d83674c292821c4bb763d27 Mon Sep 17 00:00:00 2001 From: Tadeusz Niemiec Date: Fri, 21 Aug 2020 10:03:21 +0200 Subject: [PATCH] rename SwitchEntity to SwitchDevice --- custom_components/localtuya/switch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/localtuya/switch.py b/custom_components/localtuya/switch.py index 0a597a97e..bdded3fb1 100644 --- a/custom_components/localtuya/switch.py +++ b/custom_components/localtuya/switch.py @@ -22,12 +22,12 @@ sw02: name: usb_plug friendly_name: USB Plug - id: 7 + id: 7 """ import logging import voluptuous as vol -from homeassistant.components.switch import ENTITY_ID_FORMAT, SwitchEntity, PLATFORM_SCHEMA +from homeassistant.components.switch import ENTITY_ID_FORMAT, SwitchDevice, PLATFORM_SCHEMA from homeassistant.const import (CONF_HOST, CONF_ID, CONF_SWITCHES, CONF_FRIENDLY_NAME, CONF_ICON, CONF_NAME) import homeassistant.helpers.config_validation as cv from time import time, sleep @@ -194,7 +194,7 @@ def status(self): finally: self._lock.release() -class TuyaDevice(SwitchEntity): +class TuyaDevice(SwitchDevice): """Representation of a Tuya switch.""" def __init__(self, device, name, friendly_name, icon, switchid, attr_current, attr_consumption, attr_voltage):