Skip to content

Commit

Permalink
Improved async. Fix #97.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed May 22, 2020
1 parent 5947891 commit 350a18b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion custom_components/browser_mod/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def async_setup(hass, config):

await setup_connection(hass, config)

setup_service(hass)
await setup_service(hass)

return True

Expand Down
4 changes: 2 additions & 2 deletions custom_components/browser_mod/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import datetime

from homeassistant.const import STATE_UNAVAILABLE, STATE_ON, STATE_OFF
from homeassistant.components.light import Light, SUPPORT_BRIGHTNESS
from homeassistant.components.light import LightEntity, SUPPORT_BRIGHTNESS

from .helpers import setup_platform, BrowserModEntity

Expand All @@ -11,7 +11,7 @@
async def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
return setup_platform(hass, config, async_add_devices, PLATFORM, BrowserModLight)

class BrowserModLight(Light, BrowserModEntity):
class BrowserModLight(LightEntity, BrowserModEntity):
domain = PLATFORM

def __init__(self, hass, connection, deviceID, alias=None):
Expand Down
4 changes: 2 additions & 2 deletions custom_components/browser_mod/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
SUPPORT_PLAY, SUPPORT_PLAY_MEDIA,
SUPPORT_PAUSE, SUPPORT_STOP,
SUPPORT_VOLUME_SET, SUPPORT_VOLUME_MUTE,
MediaPlayerDevice,
MediaPlayerEntity,
)
from homeassistant.const import (
STATE_UNAVAILABLE,
Expand All @@ -23,7 +23,7 @@ async def async_setup_platform(hass, config, async_add_devices, discovery_info=N
return setup_platform(hass, config, async_add_devices, PLATFORM, BrowserModPlayer)


class BrowserModPlayer(MediaPlayerDevice, BrowserModEntity):
class BrowserModPlayer(MediaPlayerEntity, BrowserModEntity):
domain = PLATFORM

def __init__(self, hass, connection, deviceID, alias=None):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/browser_mod/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

_LOGGER = logging.getLogger(__name__)

def setup_service(hass):
async def setup_service(hass):

def handle_command(call):
command = call.data.get("command", None)
Expand Down

0 comments on commit 350a18b

Please sign in to comment.