Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

Add support for subscribed state updates and input commands #19

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pylgtv/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .webos_client import WebOsClient
from .webos_client import PyLGTVPairException
from .webos_client import PyLGTVCmdException
1 change: 1 addition & 0 deletions pylgtv/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@
EP_SET_CHANNEL = "tv/openChannel"
EP_SET_INPUT = "tv/switchInput"
EP_CLOSE_WEB_APP = "webapp/closeWebApp"
EP_INPUT_SOCKET = "com.webos.service.networkinput/getPointerInputSocket"
74 changes: 0 additions & 74 deletions pylgtv/handshake.json

This file was deleted.

86 changes: 86 additions & 0 deletions pylgtv/handshake.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
SIGNATURE = ("eyJhbGdvcml0aG0iOiJSU0EtU0hBMjU2Iiwia2V5SWQiOiJ0ZXN0LXNpZ25pbm" +
"ctY2VydCIsInNpZ25hdHVyZVZlcnNpb24iOjF9.hrVRgjCwXVvE2OOSpDZ58hR" +
"+59aFNwYDyjQgKk3auukd7pcegmE2CzPCa0bJ0ZsRAcKkCTJrWo5iDzNhMBWRy" +
"aMOv5zWSrthlf7G128qvIlpMT0YNY+n/FaOHE73uLrS/g7swl3/qH/BGFG2Hu4" +
"RlL48eb3lLKqTt2xKHdCs6Cd4RMfJPYnzgvI4BNrFUKsjkcu+WD4OO2A27Pq1n" +
"50cMchmcaXadJhGrOqH5YmHdOCj5NSHzJYrsW0HPlpuAx/ECMeIZYDh6RMqaFM" +
"2DXzdKX9NmmyqzJ3o/0lkk/N97gfVRLW5hA29yeAwaCViZNCP8iC9aO0q9fQoj" +
"oa7NQnAtw==")

REGISTRATION_PAYLOAD = {
"forcePairing": False,
"manifest": {
"appVersion": "1.1",
"manifestVersion": 1,
"permissions": [
"LAUNCH",
"LAUNCH_WEBAPP",
"APP_TO_APP",
"CLOSE",
"TEST_OPEN",
"TEST_PROTECTED",
"CONTROL_AUDIO",
"CONTROL_DISPLAY",
"CONTROL_INPUT_JOYSTICK",
"CONTROL_INPUT_MEDIA_RECORDING",
"CONTROL_INPUT_MEDIA_PLAYBACK",
"CONTROL_INPUT_TV",
"CONTROL_POWER",
"READ_APP_STATUS",
"READ_CURRENT_CHANNEL",
"READ_INPUT_DEVICE_LIST",
"READ_NETWORK_STATE",
"READ_RUNNING_APPS",
"READ_TV_CHANNEL_LIST",
"WRITE_NOTIFICATION_TOAST",
"READ_POWER_STATE",
"READ_COUNTRY_INFO"
],
"signatures": [
{
"signature": SIGNATURE,
"signatureVersion": 1
}
],
"signed": {
"appId": "com.lge.test",
"created": "20140509",
"localizedAppNames": {
"": "LG Remote App",
"ko-KR": u"리모컨 앱",
"zxx-XX": u"ЛГ Rэмotэ AПП"
},
"localizedVendorNames": {
"": "LG Electronics"
},
"permissions": [
"TEST_SECURE",
"CONTROL_INPUT_TEXT",
"CONTROL_MOUSE_AND_KEYBOARD",
"READ_INSTALLED_APPS",
"READ_LGE_SDX",
"READ_NOTIFICATIONS",
"SEARCH",
"WRITE_SETTINGS",
"WRITE_NOTIFICATION_ALERT",
"CONTROL_POWER",
"READ_CURRENT_CHANNEL",
"READ_RUNNING_APPS",
"READ_UPDATE_INFO",
"UPDATE_FROM_REMOTE_APP",
"READ_LGE_TV_INPUT_EVENTS",
"READ_TV_CURRENT_TIME"
],
"serial": "2f930e2d2cfe083771f68e4fe7bb07",
"vendorId": "com.lge"
}
},
"pairingType": "PROMPT"
}


REGISTRATION_MESSAGE = {
'type': "register",
'id': "register_0",
'payload': REGISTRATION_PAYLOAD,
}
Loading