Fix service missing key in Blink (#105387)

* fix update service
refactor service yaml

* Remove leftover target
This commit is contained in:
mkmer 2023-12-09 13:18:59 -05:00 committed by GitHub
parent 35b733fa2c
commit c96a588934
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 60 additions and 19 deletions

View file

@ -25,6 +25,11 @@ from .const import (
)
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]),
@ -152,7 +157,7 @@ def setup_services(hass: HomeAssistant) -> None:
# 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,

View file

@ -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"
@ -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"
@ -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:

View file

@ -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",
@ -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."
}
}
},
@ -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."
}
}
},
@ -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."
}
}
}