0c91ba4a50e58734553bfb00fad5a3abab8abe43,homeassistant/components/media_player/gpmdp.py,GPMDP,update,#GPMDP#,179
Before Change
from websocket import _exceptions
try:
msg = json.loads(websocket.recv())
if msg["channel"] == "lyrics":
receiving = False // end of now playing data
elif msg["channel"] == "playState":
if msg["payload"] is True:
self._status = STATE_PLAYING
else:
self._status = STATE_PAUSED
elif msg["channel"] == "track":
self._title = (msg["payload"]["title"])
self._artist = (msg["payload"]["artist"])
self._albumart = (msg["payload"]["albumArt"])
except (_exceptions.WebSocketTimeoutException,
_exceptions.WebSocketProtocolException,
_exceptions.WebSocketPayloadException):
return
After Change
return
self._status = STATE_PLAYING if playstate["value"] else STATE_PAUSED
time_data = self.send_msg_with_req_id("getCurrentTime")
if time_data is None:
return
self._seek_position = int(time_data["value"] / 1000)
track_data = self.send_msg_with_req_id("getCurrentTrack")
if track_data is None:
return
self._title = track_data["value"]["title"]
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 11
Instances
Project Name: home-assistant/home-assistant
Commit Name: 0c91ba4a50e58734553bfb00fad5a3abab8abe43
Time: 2016-08-23
Author: nkgilley@gmail.com
File Name: homeassistant/components/media_player/gpmdp.py
Class Name: GPMDP
Method Name: update
Project Name: analysiscenter/batchflow
Commit Name: 29f852d88e32f616437a6ca5cf6f886680523ede
Time: 2019-10-31
Author: 7520522+a-arefina@users.noreply.github.com
File Name: batchflow/utils.py
Class Name:
Method Name: plot_results_by_config
Project Name: senarvi/theanolm
Commit Name: eb8b70c825ef3e02818cbfa95c0f8a9ec4184275
Time: 2015-12-25
Author: seppo.git@marjaniemi.com
File Name: theanolm/network.py
Class Name: Network
Method Name: __init__