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

@ -5,7 +5,7 @@ from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import CONF_TYPE
from .const import CONF_TYPE_OWSERVER, DOMAIN, SENSOR_TYPE_SENSED
from .onewire_entities import OneWireProxy
from .onewire_entities import OneWireProxyEntity
from .onewirehub import OneWireHub
DEVICE_BINARY_SENSORS = {
@ -109,7 +109,7 @@ def get_entities(onewirehub: OneWireHub):
os.path.split(device["path"])[0], device_sensor["path"]
)
entities.append(
OneWireBinarySensor(
OneWireProxyBinarySensor(
sensor_id,
device_file,
device_sensor["type"],
@ -123,7 +123,7 @@ def get_entities(onewirehub: OneWireHub):
return entities
class OneWireBinarySensor(BinarySensorEntity, OneWireProxy):
class OneWireProxyBinarySensor(OneWireProxyEntity, BinarySensorEntity):
"""Implementation of a 1-Wire binary sensor."""
@property