Skip to content

Commit

Permalink
fix(sensor): inherit from SensorEntity
Browse files Browse the repository at this point in the history
closes #1633
  • Loading branch information
alandtse committed Jun 26, 2022
1 parent 22a6eb1 commit c28b8ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/alexa_media/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import logging
from typing import Callable, List, Optional, Text # noqa pylint: disable=unused-import

from homeassistant.components.sensor import SensorEntity
from homeassistant.const import (
DEVICE_CLASS_TIMESTAMP,
STATE_UNAVAILABLE,
Expand All @@ -18,7 +19,6 @@
)
from homeassistant.exceptions import ConfigEntryNotReady, NoEntitySpecifiedError
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.event import async_track_point_in_utc_time
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.util import dt
Expand Down Expand Up @@ -182,7 +182,7 @@ def lookup_device_info(account_dict, device_serial):
return None


class TemperatureSensor(CoordinatorEntity):
class TemperatureSensor(SensorEntity, CoordinatorEntity):
"""A temperature sensor reported by an Echo."""

def __init__(self, coordinator, entity_id, name, media_player_device_id):
Expand Down Expand Up @@ -222,7 +222,7 @@ def unique_id(self):
return self.alexa_entity_id + "_temperature"


class AlexaMediaNotificationSensor(Entity):
class AlexaMediaNotificationSensor(SensorEntity):
"""Representation of Alexa Media sensors."""

def __init__(
Expand Down

0 comments on commit c28b8ef

Please sign in to comment.