Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename SwitchEntity to SwitchDevice #1

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions custom_components/localtuya/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down