sehaas/ha_hisense_tv

No "Power on" possible

MaikGoe opened this issue · 4 comments

I just installed the integration. Now it works like a charm.
But I can't power on the TV via Wake-on-WLAN.
If i switch the TV off, its state switches to "off" immediately followed by "not available" an I get this Error Message:
"Fehler beim Aufrufen des Diensts switch/turn_on. str, bytes or bytearray expected, not NoneType"

Which HA version are you running? Have you checked the changelog if there where changes in the WoL integration?

Nikey commented

Same issue here with newest version

Same error here with HA 2022.11:

2022-11-18 22:49:43.894 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139716808616176] str, bytes or bytearray expected, not NoneType
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 943, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
    await result
  File "/config/custom_components/hisense_tv/media_player.py", line 226, in async_turn_on
    wakeonlan.send_magic_packet(self._mac, ip_address=self._ip_address)
  File "/usr/local/lib/python3.10/site-packages/wakeonlan.py", line 56, in send_magic_packet
    sock.connect((ip_address, port))
TypeError: str, bytes or bytearray expected, not NoneType

Fixed with #38