update to reflect immich api changes
This commit is contained in:
parent
d3a641e1f8
commit
e05196ff83
@ -12,7 +12,7 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: Load program variables
|
- name: Load program variables
|
||||||
ansible.builtin.include_vars:
|
ansible.builtin.include_vars:
|
||||||
file: ../program_variables.yml
|
file: ./program_variables.yml
|
||||||
name: program_variables
|
name: program_variables
|
||||||
|
|
||||||
- name: Pull the latest version of the code
|
- name: Pull the latest version of the code
|
||||||
|
@ -53,8 +53,3 @@
|
|||||||
reboot:
|
reboot:
|
||||||
connect_timeout: 20
|
connect_timeout: 20
|
||||||
reboot_timeout: 300
|
reboot_timeout: 300
|
||||||
|
|
||||||
- name: Wait for the Raspberry Pi to reboot
|
|
||||||
wait_for_connection:
|
|
||||||
delay: 5
|
|
||||||
timeout: 300
|
|
||||||
|
@ -5,6 +5,7 @@ Description=Show new photo onto the eink display
|
|||||||
Type=oneshot
|
Type=oneshot
|
||||||
User={{ ansible_user }}
|
User={{ ansible_user }}
|
||||||
WorkingDirectory={{ code_dest }}
|
WorkingDirectory={{ code_dest }}
|
||||||
|
ExecStartPre=/bin/sleep 30
|
||||||
ExecStart=python main.py
|
ExecStart=python main.py
|
||||||
Environment="OWN_IMAGE_PERCENT={{ program_variables.OWN_IMAGE_PERCENT }}"
|
Environment="OWN_IMAGE_PERCENT={{ program_variables.OWN_IMAGE_PERCENT }}"
|
||||||
Environment="RECIPIENT={{ program_variables.RECIPIENT }}"
|
Environment="RECIPIENT={{ program_variables.RECIPIENT }}"
|
||||||
|
@ -46,7 +46,7 @@ class ImageGetImmich(ImageGet):
|
|||||||
|
|
||||||
|
|
||||||
def get_image_file(self, image_id: str) -> bytearray:
|
def get_image_file(self, image_id: str) -> bytearray:
|
||||||
url = self.base_url + "asset/download/" + image_id
|
url = self.base_url + "download/asset/" + image_id
|
||||||
|
|
||||||
headers = self.headers | {"Accept": "application/octet-stream"}
|
headers = self.headers | {"Accept": "application/octet-stream"}
|
||||||
response = h.request("POST", url, headers=headers, data={})
|
response = h.request("POST", url, headers=headers, data={})
|
||||||
|
@ -1,15 +1,19 @@
|
|||||||
import sys
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
import os
|
||||||
|
|
||||||
from image_convert import ImageShrink
|
from image_convert import ImageShrink
|
||||||
from get.combined import ImageGetCombined
|
from get.combined import ImageGetCombined
|
||||||
from get.template import ImageGetException
|
from get.template import ImageGetException
|
||||||
from image_show import ImageShow
|
from image_show import ImageShow
|
||||||
import notify
|
import notify
|
||||||
import os
|
|
||||||
|
VARS = Path("../deploy/program_variables.yml")
|
||||||
|
|
||||||
if os.getenv("IMMICH_API_URL") is None:
|
if os.getenv("IMMICH_API_URL") is None:
|
||||||
# values are not set, import them from local yaml file
|
# values are not set, import them from local yaml file
|
||||||
import yaml
|
import yaml
|
||||||
with open("../deploy/program_variables.yml", "r") as f:
|
with open(VARS, "r") as f:
|
||||||
config = yaml.safe_load(f)
|
config = yaml.safe_load(f)
|
||||||
for key, value in config.items():
|
for key, value in config.items():
|
||||||
os.environ[key] = value
|
os.environ[key] = value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user