Oke. I tried linking it to my website where the images have their own path with {titleid}.jpg as name and i got it working.
I also tried to make it so it downloads the image to a folder and shows the local image, but i think it has to be an online link, a local path to a file is not working. So from an online source (for now my site) it is working. If you like it i could shoot in a pull request to review it?
I also encountered an error when the game name is: Tom Clancy’s Ghost Recon Wildlands or Tom Clancy’s The Division
So im pretty sure its because of the ’ ? When this happens it doesn’t say the game name but says “idle”.
This is the error:
17-04-28 23:15:53 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.playstation_4 fails
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/custom_components/media_player/ps4.py", line 281, in search
data = json.loads(value)
File "/usr/lib/python3.4/json/__init__.py", line 318, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.4/json/decoder.py", line 359, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Invalid \escape: line 11 column 32 (char 295)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
None, self.update)
File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/util/__init__.py", line 303, in wrapper
result = method(*args, **kwargs)
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/util/__init__.py", line 303, in wrapper
result = method(*args, **kwargs)
File "/home/homeassistant/.homeassistant/custom_components/media_player/ps4.py", line 94, in update
data = self.ps4.search()
File "/home/homeassistant/.homeassistant/custom_components/media_player/ps4.py", line 282, in search
except json.decoder.JSONDecodeError:
AttributeError: 'module' object has no attribute 'JSONDecodeError'