Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some classes are deprecated #17

Merged
merged 8 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion alarm_control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
devices.append(XiaomiGatewayAlarm(gateway))
add_entities(devices)

class XiaomiGatewayAlarm(XiaomiGwDevice, alarm.AlarmControlPanel):
class XiaomiGatewayAlarm(XiaomiGwDevice, alarm.AlarmControlPanelEntity):

def __init__(self, gw):
XiaomiGwDevice.__init__(self, gw, "alarm_control_panel", None, "miio.gateway", "Gateway Alarm")
Expand Down
4 changes: 2 additions & 2 deletions binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import timedelta

from homeassistant.components.binary_sensor import (
BinarySensorDevice, DEVICE_CLASSES)
BinarySensorEntity, DEVICE_CLASSES)

from homeassistant.helpers.event import async_track_point_in_utc_time
import homeassistant.util.dt as dt_util
Expand Down Expand Up @@ -78,7 +78,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(entities)
return True

class XiaomiGwBinarySensor(XiaomiGwDevice, BinarySensorDevice):
class XiaomiGwBinarySensor(XiaomiGwDevice, BinarySensorEntity):

def __init__(self, gw, device_class, sid, name, restore):
XiaomiGwDevice.__init__(self, gw, "binary_sensor", device_class, sid, name, restore)
Expand Down
4 changes: 2 additions & 2 deletions light.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import struct

from homeassistant.components.light import (
Light, ATTR_BRIGHTNESS, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS, SUPPORT_COLOR)
LightEntity, ATTR_BRIGHTNESS, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS, SUPPORT_COLOR)
import homeassistant.util.color as color_util

from . import DOMAIN, XiaomiGwDevice
Expand All @@ -17,7 +17,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
devices.append(XiaomiGatewayLight(gateway))
add_entities(devices)

class XiaomiGatewayLight(XiaomiGwDevice, Light):
class XiaomiGatewayLight(XiaomiGwDevice, LightEntity):

def __init__(self, gw):
XiaomiGwDevice.__init__(self, gw, "light", None, "miio.gateway", "Gateway LED")
Expand Down
4 changes: 2 additions & 2 deletions media_player.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from datetime import timedelta

from homeassistant.components.media_player import MediaPlayerDevice
from homeassistant.components.media_player import MediaPlayerEntity
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC, SUPPORT_VOLUME_SET, SUPPORT_VOLUME_MUTE, SUPPORT_PLAY_MEDIA,
SUPPORT_PLAY, SUPPORT_STOP)
Expand All @@ -27,7 +27,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
devices.append(XiaomiGatewayLight(gateway))
add_entities(devices)

class XiaomiGatewayLight(XiaomiGwDevice, MediaPlayerDevice):
class XiaomiGatewayLight(XiaomiGwDevice, MediaPlayerEntity):

def __init__(self, gw):
XiaomiGwDevice.__init__(self, gw, "media_player", None, "miio.gateway", "Gateway Player")
Expand Down