-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Farzad E
committed
May 30, 2022
1 parent
52baf84
commit 5025667
Showing
1 changed file
with
18 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,42 @@ | ||
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) |