Fix incorrect usage of ToggleEntity in switch platforms (#64620)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
This commit is contained in:
parent
604a900658
commit
4c83ecd7bd
21 changed files with 44 additions and 51 deletions
|
@ -4,11 +4,10 @@ from __future__ import annotations
|
|||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components import rpi_gpio
|
||||
from homeassistant.components.switch import PLATFORM_SCHEMA
|
||||
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity
|
||||
from homeassistant.const import DEVICE_DEFAULT_NAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import ToggleEntity
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.reload import setup_reload_service
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
@ -49,7 +48,7 @@ def setup_platform(
|
|||
add_entities(switches)
|
||||
|
||||
|
||||
class RPiGPIOSwitch(ToggleEntity):
|
||||
class RPiGPIOSwitch(SwitchEntity):
|
||||
"""Representation of a Raspberry Pi GPIO."""
|
||||
|
||||
def __init__(self, name, port, invert_logic):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue