diff --git a/example/art_remove_mats.py b/example/art_remove_mats.py index 267e36b..952fb83 100644 --- a/example/art_remove_mats.py +++ b/example/art_remove_mats.py @@ -1,7 +1,7 @@ -import sys import logging +import sys -sys.path.append('../') +sys.path.append("../") from samsungtvws import SamsungTVWS @@ -9,26 +9,35 @@ 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)