Skip to content

Commit

Permalink
fix import for SwitchEntity to avoid warnings on older versions of HA…
Browse files Browse the repository at this point in the history
… as well
  • Loading branch information
snicker committed Aug 2, 2020
1 parent 92f5d50 commit e5870b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/noonlight/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit e5870b4

Please sign in to comment.