Skip to content

Commit

Permalink
Merge pull request #25 from napyk/master
Browse files Browse the repository at this point in the history
Add installed apps to source list
  • Loading branch information
antonioparraga committed Dec 17, 2018
2 parents afa16b9 + 80011c6 commit 28b431a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion braviarc/braviarc.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ def load_source_list(self):
self._jdata_build("getContentList", result))
if not resp.get('error'):
original_content_list.extend(resp.get('result')[0])

resp = self.bravia_req_json("sony/appControl",
self._jdata_build("getApplicationList", None))
if not resp.get('error'):
results = resp.get('result')[0]
original_content_list+=results

return_value = collections.OrderedDict()
for content_item in original_content_list:
Expand Down Expand Up @@ -367,7 +373,10 @@ def select_source(self, source):

def play_content(self, uri):
"""Play content by URI."""
self.bravia_req_json("sony/avContent", self._jdata_build("setPlayContent", {"uri": uri}))
if uri.startswith("com.sony.dtv"):
self.bravia_req_json("sony/appControl", self._jdata_build("setActiveApp", {"uri": uri}))
else:
self.bravia_req_json("sony/avContent", self._jdata_build("setPlayContent", {"uri": uri}))

def media_play(self):
"""Send play command."""
Expand Down

0 comments on commit 28b431a

Please sign in to comment.