diff --git a/panasonic_viera/__init__.py b/panasonic_viera/__init__.py index 8d6d981..ed492ee 100644 --- a/panasonic_viera/__init__.py +++ b/panasonic_viera/__init__.py @@ -14,6 +14,7 @@ import asyncio import aiohttp.web from http import HTTPStatus +import re try: from urllib.request import urlopen, Request, HTTPError, build_opener, HTTPHandler except: @@ -658,7 +659,13 @@ def get_apps(self): res = self.soap_request(URL_CONTROL_NRC, URN_REMOTE_CONTROL, 'X_GetAppList', None) - return res + apps = res.split("vc_app")[1:] + app_list = {} + for app in apps: + prod_id = re.search('(?<=product_id\=)(.*?)(?=')', app).group(0) + name = re.search('(?<='+prod_id+'')(.*?)(?=')', app).group(0) + app_list[name] = prod_id + return app_list def get_vector_info(self): """Return the vector info on the TV"""