From b4490e9f90a6d498b678677122480a44d9f878d6 Mon Sep 17 00:00:00 2001 From: Knapoc Date: Tue, 26 May 2020 20:58:26 +0200 Subject: [PATCH] fix entity class name for binary sensor --- custom_components/nintendo_wishlist/binary_sensor.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/custom_components/nintendo_wishlist/binary_sensor.py b/custom_components/nintendo_wishlist/binary_sensor.py index 8273941..86545f6 100644 --- a/custom_components/nintendo_wishlist/binary_sensor.py +++ b/custom_components/nintendo_wishlist/binary_sensor.py @@ -2,9 +2,13 @@ from typing import List from homeassistant import core -from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.util import slugify +try: + from homeassistant.components.binary_sensor import BinarySensorEntity +except ImportError: + from homeassistant.components.binary_sensor import BinarySensorDevice as BinarySensorEntity + from .const import DOMAIN from .types import SwitchGame @@ -23,7 +27,7 @@ async def async_setup_platform( async_add_entities(sensors, True) -class SwitchGameQueryEntity(BinarySensorDevice): +class SwitchGameQueryEntity(BinarySensorEntity): """Represents a Query for a switch game.""" def __init__(self, coordinator, game_title: str):