Skip to content

Commit

Permalink
Style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Farzad E committed May 30, 2022
1 parent 52baf84 commit 752ff4b
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions example/art_remove_mats.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
import sys
import logging
import sys

sys.path.append('../')
sys.path.append("../")

from samsungtvws import SamsungTVWS

# Increase debug level
logging.basicConfig(level=logging.INFO)

# Normal constructor
tv = SamsungTVWS('192.168.xxx.xxx')
tv = SamsungTVWS("192.168.xxx.xxx")

# Set all mats to this type
target_matte_type = 'none'
target_matte_type = "none"

# Is art mode supported?
if not tv.art().supported():
logging.error('Art mode not supported')
logging.error("Art mode not supported")
sys.exit(1)

# List available mats for displaying art
matte_types = [matte_type for elem in tv.art().get_matte_list() for matte_type in elem.values()]
matte_types = [
matte_type for elem in tv.art().get_matte_list() for matte_type in elem.values()
]

if target_matte_type not in matte_types:
logging.error('Invalid matte type: {}. Supported matte types are: {}'.format(target_matte_type, matte_types))
logging.error(
"Invalid matte type: {}. Supported matte types are: {}".format(
target_matte_type, matte_types
)
)
sys.exit(1)

# List the art available on the device
available_art = tv.art().available()

for art in available_art:
if art['matte_id'] != target_matte_type:
logging.info("Setting matte to {} for {}".format(target_matte_type, art['content_id']))
tv.art().change_matte(art['content_id'], target_matte_type)
if art["matte_id"] != target_matte_type:
logging.info(
"Setting matte to {} for {}".format(target_matte_type, art["content_id"])
)
tv.art().change_matte(art["content_id"], target_matte_type)

0 comments on commit 752ff4b

Please sign in to comment.