Skip to content

Commit

Permalink
updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
NickWaterton committed Dec 9, 2024
1 parent 74c997d commit d626df4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions example/async_art.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@
from samsungtvws.async_art import SamsungTVAsyncArt
from samsungtvws import exceptions

logging.basicConfig(level=logging.INFO) #or logging.DEBUG to see messages

def parseargs():
# Add command line argument parsing
parser = argparse.ArgumentParser(description='Example async art Samsung Frame TV.')
parser.add_argument('ip', action="store", type=str, default=None, help='ip address of TV (default: %(default)s))')
parser.add_argument('-D','--debug', action='store_true', default=False, help='Debug mode (default: %(default)s))')
return parser.parse_args()

async def image_callback(event, response):
logging.info('CALLBACK: image callback: {}, {}'.format(event, response))

async def main():
args = parseargs()
logging.basicConfig(level=logging.DEBUG if args.debug else logging.INFO)
logging.debug('debug mode')
tv = SamsungTVAsyncArt(host=args.ip, port=8002)
await tv.start_listening()

Expand Down
2 changes: 1 addition & 1 deletion example/async_art_update_from_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ async def check_dir(self):
scan folder for new, deleted or updated files, but only when tv is in art mode
'''
try:
if self.tv.art_mode:
if await self.tv.is_artmode():
self.log.info('checking directory: {}{}'.format(self.folder, ' every {}'.format(self.get_time(self.period)) if self.period else ''))
files = self.get_folder_files()
await self.sync_file_list()
Expand Down
2 changes: 1 addition & 1 deletion samsungtvws/async_art.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(
port=8001,
timeout=None,
key_press_delay=1,
name="SamsungTvRemote",
name="SamsungTvArt",
):
super().__init__(
host,
Expand Down

0 comments on commit d626df4

Please sign in to comment.