Skip to content

Commit c4fce1c

Browse files
authored
Improve unpair schema in homekit (home-assistant#150235)
1 parent 581f8a9 commit c4fce1c

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

homeassistant/components/homekit/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,8 @@ def _has_all_unique_names_and_ports(
224224
)
225225

226226

227-
UNPAIR_SERVICE_SCHEMA = vol.All(
228-
vol.Schema(cv.ENTITY_SERVICE_FIELDS),
229-
cv.has_at_least_one_key(ATTR_DEVICE_ID),
227+
UNPAIR_SERVICE_SCHEMA = vol.Schema(
228+
{vol.Required(ATTR_DEVICE_ID): vol.All(cv.ensure_list, [str])}
230229
)
231230

232231

homeassistant/components/homekit/services.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ reset_accessory:
66
entity: {}
77

88
unpair:
9-
target:
10-
device:
11-
integration: homekit
9+
fields:
10+
device_id:
11+
required: true
12+
selector:
13+
device:
14+
multiple: true
15+
integration: homekit

homeassistant/components/homekit/strings.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@
8080
},
8181
"unpair": {
8282
"name": "Unpair an accessory or bridge",
83-
"description": "Forcefully removes all pairings from an accessory to allow re-pairing. Use this action if the accessory is no longer responsive, and you want to avoid deleting and re-adding the entry. Room locations, and accessory preferences will be lost."
83+
"description": "Forcefully removes all pairings from an accessory to allow re-pairing. Use this action if the accessory is no longer responsive and you want to avoid deleting and re-adding the entry. Room locations and accessory preferences will be lost.",
84+
"fields": {
85+
"device_id": {
86+
"name": "Device",
87+
"description": "Device to unpair."
88+
}
89+
}
8490
}
8591
}
8692
}

0 commit comments

Comments
 (0)