Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix service missing key in Blink #105387

Merged
merged 3 commits into from Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion homeassistant/components/blink/services.py
Expand Up @@ -25,6 +25,11 @@
)
from .coordinator import BlinkUpdateCoordinator

SERVICE_UPDATE_SCHEMA = vol.Schema(
{
vol.Required(ATTR_DEVICE_ID): vol.All(cv.ensure_list, [cv.string]),
}
)
SERVICE_SAVE_VIDEO_SCHEMA = vol.Schema(
{
vol.Required(ATTR_DEVICE_ID): vol.All(cv.ensure_list, [cv.string]),
Expand Down Expand Up @@ -152,7 +157,7 @@ async def blink_refresh(call: ServiceCall):

# Register all the above services
service_mapping = [
(blink_refresh, SERVICE_REFRESH, None),
(blink_refresh, SERVICE_REFRESH, SERVICE_UPDATE_SCHEMA),
(
async_handle_save_video_service,
SERVICE_SAVE_VIDEO,
Expand Down
44 changes: 28 additions & 16 deletions homeassistant/components/blink/services.yaml
@@ -1,18 +1,28 @@
# Describes the format for available Blink services

blink_update:
fields:
device_id:
required: true
selector:
device:
integration: blink

trigger_camera:
target:
entity:
integration: blink
domain: camera
fields:
device_id:
required: true
selector:
device:
integration: blink

save_video:
target:
entity:
integration: blink
domain: camera
fields:
device_id:
required: true
selector:
device:
integration: blink
name:
required: true
example: "Living Room"
Expand All @@ -25,11 +35,12 @@ save_video:
text:

save_recent_clips:
target:
entity:
integration: blink
domain: camera
fields:
device_id:
required: true
selector:
device:
integration: blink
name:
required: true
example: "Living Room"
Expand All @@ -42,11 +53,12 @@ save_recent_clips:
text:

send_pin:
target:
entity:
integration: blink
domain: camera
fields:
device_id:
required: true
selector:
device:
integration: blink
pin:
example: "abc123"
selector:
Expand Down
28 changes: 26 additions & 2 deletions homeassistant/components/blink/strings.json
Expand Up @@ -57,11 +57,23 @@
"services": {
"blink_update": {
"name": "Update",
"description": "Forces a refresh."
"description": "Forces a refresh.",
"fields": {
"device_id": {
"name": "Device ID",
"description": "The Blink device id."
}
}
},
"trigger_camera": {
"name": "Trigger camera",
"description": "Requests camera to take new image."
"description": "Requests camera to take new image.",
"fields": {
"device_id": {
"name": "Device ID",
"description": "The Blink device id."
}
}
},
"save_video": {
"name": "Save video",
Expand All @@ -74,6 +86,10 @@
"filename": {
"name": "File name",
"description": "Filename to writable path (directory may need to be included in allowlist_external_dirs in config)."
},
"device_id": {
"name": "Device ID",
"description": "The Blink device id."
}
}
},
Expand All @@ -88,6 +104,10 @@
"file_path": {
"name": "Output directory",
"description": "Directory name of writable path (directory may need to be included in allowlist_external_dirs in config)."
},
"device_id": {
"name": "Device ID",
"description": "The Blink device id."
}
}
},
Expand All @@ -98,6 +118,10 @@
"pin": {
"name": "Pin",
"description": "PIN received from blink. Leave empty if you only received a verification email."
},
"device_id": {
"name": "Device ID",
"description": "The Blink device id."
}
}
}
Expand Down