Skip to content

Commit

Permalink
Updated blueprints to v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinfrlch committed Oct 19, 2024
1 parent 33c72d3 commit 4cc511a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
11 changes: 10 additions & 1 deletion blueprints/camera_motion_summary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ blueprint:
number:
min: 1
max: 60
max_frames:
name: Max Frames
description: How many frames to analyze. Picks frames with the most movement.
default: 3
selector:
number:
min: 1
max: 10
step: 1
target_width:
name: Target Width
description: Width in pixels to downscale (uses less tokens)
Expand Down Expand Up @@ -138,7 +147,7 @@ action:
model: !input model
message: !input message
image_entity: !input camera_entities
interval: !input interval
max_frames: !input max_frames
duration: !input duration
include_filename: true
target_width: !input target_width
Expand Down
19 changes: 14 additions & 5 deletions blueprints/frigate_event_summary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ blueprint:
multiline: false
cooldown:
name: Cooldown
description: Time in minutes to wait before running again
description: Time in minutes to wait before running again.
default: 10
selector:
number:
Expand Down Expand Up @@ -45,12 +45,21 @@ blueprint:
multiline: true
interval:
name: Interval
description: Analyze frames every <interval> seconds
default: 3
description: "DEPRECATED: Use max_frames. Analyze frames every <interval> seconds"
default: 2
selector:
number:
min: 1
max: 60
max_frames:
name: Max Frames
description: How many frames to analyze. Picks frames with the most movement.
default: 3
selector:
number:
min: 1
max: 10
step: 1
target_width:
name: Target Width
description: Width in pixels to downscale (uses less tokens)
Expand All @@ -62,7 +71,7 @@ blueprint:
detail:
name: Detail
description: Detail parameter (OpenAI only)
default: 'high'
default: 'low'
selector:
select:
options:
Expand Down Expand Up @@ -139,7 +148,7 @@ action:
provider: !input provider
model: !input model
message: !input message
interval: !input interval
max_frames: !input max_frames
include_filename: false
target_width: !input target_width
detail: !input detail
Expand Down
4 changes: 2 additions & 2 deletions custom_components/llmvision/media_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,13 @@ async def add_videos(self, video_paths, event_ids, max_frames, target_width, inc
_LOGGER.info(
f"Deleted tmp folder: {tmp_clips_dir}")
except FileNotFoundError as e:
_LOGGER.error(f"Failed to delete tmp folder: {e}")
_LOGGER.info(f"Failed to delete tmp folder: {e}")
try:
await self.hass.loop.run_in_executor(None, shutil.rmtree, tmp_frames_dir)
_LOGGER.info(
f"Deleted tmp folder: {tmp_frames_dir}")
except FileNotFoundError as e:
_LOGGER.error(f"Failed to delete tmp folders: {e}")
_LOGGER.info(f"Failed to delete tmp folders: {e}")
return self.client

async def add_streams(self, image_entities, duration, max_frames, target_width, include_filename):
Expand Down
8 changes: 4 additions & 4 deletions custom_components/llmvision/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ video_analyzer:
multiline: true
interval:
name: Interval
description: "DEPRECATED: Analyze frames every <interval> seconds. Use max_frames"
description: "DEPRECATED: Use max_frames. Analyze frames every <interval> seconds."
required: false
example: 3
default: 3
Expand All @@ -148,7 +148,7 @@ video_analyzer:
max: 60
max_frames:
name: Max Frames
description: How many frames to extract. This will pick frames with the most movement.
description: How many frames to analyze. Picks frames with the most movement.
required: false
example: 3
default: 3
Expand Down Expand Up @@ -246,7 +246,7 @@ stream_analyzer:
multiple: true
interval:
name: Interval
description: "DEPRECATED: Analyze frames every <interval> seconds. Use max_frames"
description: "DEPRECATED: Use max_frames. Analyze frames every <interval> seconds."
required: false
example: 2
default: 2
Expand All @@ -266,7 +266,7 @@ stream_analyzer:
max: 60
max_frames:
name: Max Frames
description: How many frames to extract. This will pick frames with the most movement.
description: How many frames to analyze. Picks frames with the most movement.
required: false
example: 3
default: 3
Expand Down

0 comments on commit 4cc511a

Please sign in to comment.