Skip to main content

Library to control Panasonic Viera TVs

Project description

panasonic-viera

Pipeline Status PyPI version

UPDATE (2019-03-28)

Pincode and encryption support has been added for newer TV models circa 2019. For example, the "FZ" Panasonic models. These new models require pincode authentication and communication is now encapsulated in AES-CBC-128 encryption with HMAC-SHA-256. See issue https://github.com/florianholzapfel/panasonic-viera/issues/9

Please note that these new changes have not yet been tested thoroughly, use at your own risk.

Usage

Code

Examples

Request a pin code and get credentials
import panasonic_viera
rc = panasonic_viera.RemoteControl("<HOST>")
# Make the TV display a pairing pin code
rc.request_pin_code()
# Interactively ask the user for the pin code
pin = raw_input("Enter the displayed pin code: ")
# Authorize the pin code with the TV
rc.authorize_pin_code(pincode=pin)
# Display credentials (application ID and encryption key)
print rc.app_id
print rc.enc_key
# We can now start communicating with our TV
# Send EPG key
rc.send_key(panasonic_viera.Keys.epg)
Use saved credentials
import panasonic_viera
rc = panasonic_viera.RemoteControl("<HOST>", app_id="BSkeeKuuwakd9Q==", encryption_key="EarvNQodKYlj5zTEIhZoXQ==")
# We can now start communicating with our TV
# Send EPG key
rc.send_key(panasonic_viera.Keys.epg)
Increase Volume By 1
import panasonic_viera
rc = panasonic_viera.RemoteControl("<HOST>")
volume = rc.get_volume()
rc.set_volume(volume + 1)
Send EPG Key
import panasonic_viera
rc = panasonic_viera.RemoteControl("<HOST>")
rc.send_key(panasonic_viera.Keys.epg)

Command Line

This command line starts a REPL to the TV. Therefore it is mainly used testing purposes and not for automating the TV.

usage: panasonic_viera [-h] [--verbose] host [port]

Remote control a Panasonic Viera TV.

positional arguments:
  host        Address of the Panasonic Viera TV
  port        Port of the Panasonic Viera TV. Defaults to 55000.

optional arguments:
  -h, --help  show this help message and exit
  --verbose   debug output

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

panasonic_viera-0.4.2.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

panasonic_viera-0.4.2-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file panasonic_viera-0.4.2.tar.gz.

File metadata

  • Download URL: panasonic_viera-0.4.2.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for panasonic_viera-0.4.2.tar.gz
Algorithm Hash digest
SHA256 81c14017011d0aa882d721c803607f8339b0bd1c0c0bd7c3c648026f320ea633
MD5 32de802cbb5e088fb9aaced6e5f58099
BLAKE2b-256 ff6c1ff31d78c4392b901a8f55a0e76be1a61bea04019b5ef0c226dec7a5d7e3

See more details on using hashes here.

File details

Details for the file panasonic_viera-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for panasonic_viera-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 415476277c6985f0ff6d7f5702f02f66d47267794aa032893d9864e10a46d7fd
MD5 41c41bcece44ee01a9aa16086a422824
BLAKE2b-256 bd03124ddf295b832682ad5b519fc0c123b35b2bf71f336b992f0412649b1942

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page