Skip to content
Merged
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
9 changes: 5 additions & 4 deletions homeassistant/components/media_player/panasonic_viera.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,20 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
else:
uuid = None
remote = RemoteControl(host, port)
add_entities([PanasonicVieraTVDevice(mac, name, remote, uuid)])
add_entities([PanasonicVieraTVDevice(mac, name, remote, host, uuid)])
return True

host = config.get(CONF_HOST)
remote = RemoteControl(host, port)

add_entities([PanasonicVieraTVDevice(mac, name, remote)])
add_entities([PanasonicVieraTVDevice(mac, name, remote, host)])
return True


class PanasonicVieraTVDevice(MediaPlayerDevice):
"""Representation of a Panasonic Viera TV."""

def __init__(self, mac, name, remote, uuid=None):
def __init__(self, mac, name, remote, host, uuid=None):
"""Initialize the Panasonic device."""
import wakeonlan
# Save a reference to the imported class
Expand All @@ -84,6 +84,7 @@ def __init__(self, mac, name, remote, uuid=None):
self._playing = True
self._state = None
self._remote = remote
self._host = host
self._volume = 0

@property
Expand Down Expand Up @@ -140,7 +141,7 @@ def supported_features(self):
def turn_on(self):
"""Turn on the media player."""
if self._mac:
self._wol.send_magic_packet(self._mac)
self._wol.send_magic_packet(self._mac, ip_address=self._host)
self._state = STATE_ON

def turn_off(self):
Expand Down