Update inheritance for onewire entities (#43019)

This commit is contained in:
epenet 2020-11-09 23:21:16 +01:00 committed by GitHub
parent 6f4219d709
commit 7716740c18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 36 deletions

View file

@ -6,7 +6,7 @@ from homeassistant.components.switch import SwitchEntity
from homeassistant.const import CONF_TYPE
from .const import CONF_TYPE_OWSERVER, DOMAIN, SWITCH_TYPE_LATCH, SWITCH_TYPE_PIO
from .onewire_entities import OneWireProxy
from .onewire_entities import OneWireProxyEntity
from .onewirehub import OneWireHub
DEVICE_SWITCHES = {
@ -173,7 +173,7 @@ def get_entities(onewirehub: OneWireHub):
os.path.split(device["path"])[0], device_switch["path"]
)
entities.append(
OneWireSwitch(
OneWireProxySwitch(
sensor_id,
device_file,
device_switch["type"],
@ -187,7 +187,7 @@ def get_entities(onewirehub: OneWireHub):
return entities
class OneWireSwitch(SwitchEntity, OneWireProxy):
class OneWireProxySwitch(OneWireProxyEntity, SwitchEntity):
"""Implementation of a 1-Wire switch."""
@property