diff --git a/homeassistant/components/media_player/panasonic_viera.py b/homeassistant/components/media_player/panasonic_viera.py index e5ce22e9524..e6546f7c1e2 100644 --- a/homeassistant/components/media_player/panasonic_viera.py +++ b/homeassistant/components/media_player/panasonic_viera.py @@ -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 @@ -84,6 +84,7 @@ class PanasonicVieraTVDevice(MediaPlayerDevice): self._playing = True self._state = None self._remote = remote + self._host = host self._volume = 0 @property @@ -140,7 +141,7 @@ class PanasonicVieraTVDevice(MediaPlayerDevice): 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):