Migrate rest binary_sensor and switch to TemplateEntity (#73307)

This commit is contained in:
Erik Montnemery 2022-06-28 22:53:38 +02:00 committed by GitHub
parent abf67c3153
commit 146ff83a16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 178 additions and 142 deletions

View file

@ -31,7 +31,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from . import async_get_config_and_coordinator, create_rest_data_from_config
from .const import CONF_JSON_ATTRS, CONF_JSON_ATTRS_PATH, DEFAULT_SENSOR_NAME
from .entity import BaseRestEntity
from .entity import RestEntity
from .schema import RESOURCE_SCHEMA, SENSOR_SCHEMA
_LOGGER = logging.getLogger(__name__)
@ -82,7 +82,7 @@ async def async_setup_platform(
)
class RestSensor(BaseRestEntity, TemplateSensor):
class RestSensor(RestEntity, TemplateSensor):
"""Implementation of a REST sensor."""
def __init__(
@ -94,7 +94,7 @@ class RestSensor(BaseRestEntity, TemplateSensor):
unique_id,
):
"""Initialize the REST sensor."""
BaseRestEntity.__init__(
RestEntity.__init__(
self,
coordinator,
rest,