Skip to content

Commit

Permalink
Update image selection and logging in art display functions
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsvdhoven committed Nov 28, 2024
1 parent 21385ac commit 9f69ff0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions homeassistant-samsung-frame-art-beta/art.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def upload_and_display_image(image_path):
# Assuming the response is the image ID directly
image_id = response # Directly use the string if it's the ID
print("Activating Art Mode and displaying the uploaded image...")
art.select_image(image_id) # Pass the image ID to set it in Art Mode
art.select_image(image_id, show=False) # Pass the image ID to set it in Art Mode
tv.send_key("KEY_POWERON") # Ensure the TV is ON
time.sleep(2) # Give time for the TV to process

Expand All @@ -49,7 +49,8 @@ def upload_images_in_directory(directory):
art = tv.art()

# Get the list of existing images on the TV
existing_images = art.list()
existing_images = tv.art().available()
logging.info(info)

# List all .jpg files in the directory
files = [filename for filename in os.listdir(directory) if filename.lower().endswith(".jpg")]
Expand Down Expand Up @@ -93,4 +94,7 @@ def display_random_image():
# Call the function to upload and display images
upload_images_in_directory(IMAGE_DIRECTORY)

display_random_image()
display_random_image()

info = tv.art().get_photo_filter_list()
logging.info(info)

0 comments on commit 9f69ff0

Please sign in to comment.