From e5870b4a00268e5d2f383093ede1c4c5ce17bb64 Mon Sep 17 00:00:00 2001 From: Nick Gordon Date: Sat, 1 Aug 2020 20:25:30 -0700 Subject: [PATCH] fix import for SwitchEntity to avoid warnings on older versions of HA as well --- custom_components/noonlight/switch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/noonlight/switch.py b/custom_components/noonlight/switch.py index 289495a..eed0f8d 100644 --- a/custom_components/noonlight/switch.py +++ b/custom_components/noonlight/switch.py @@ -7,9 +7,9 @@ from homeassistant.components import persistent_notification try: - from homeassistant.components.switch import SwitchDevice + from homeassistant.components.switch import SwitchEntity except ImportError: - from homeassistant.components.switch import SwitchEntity as SwitchDevice + from homeassistant.components.switch import SwitchDevice as SwitchEntity from homeassistant.helpers.event import async_track_time_interval from . import (DOMAIN, EVENT_NOONLIGHT_TOKEN_REFRESHED, @@ -37,7 +37,7 @@ def noonlight_token_refreshed(): EVENT_NOONLIGHT_TOKEN_REFRESHED, noonlight_token_refreshed) -class NoonlightSwitch(SwitchDevice): +class NoonlightSwitch(SwitchEntity): """Representation of a Noonlight alarm switch.""" def __init__(self, noonlight_integration):