From b002d616dc46cf93d930f4563e01d078f5acdf8c Mon Sep 17 00:00:00 2001 From: Hunsup Jung Date: Fri, 15 Nov 2024 19:04:54 +0900 Subject: [PATCH 1/4] Add Unlatch command and Unlatched status (Unbolt feature) Signed-off-by: Hunsup Jung --- .../matter-lock/profiles/lock-unlatch.yml | 23 +++++++++++++ .../lock-user-pin-schedule-unlatch.yml | 29 +++++++++++++++++ .../profiles/lock-user-pin-unlatch.yml | 27 ++++++++++++++++ .../profiles/lock-user-schedule-unlatch.yml | 27 ++++++++++++++++ .../profiles/lock-user-unlatch.yml | 25 +++++++++++++++ .../matter-lock/src/new-matter-lock/init.lua | 32 ++++++++++++++++++- 6 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml create mode 100644 drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch.yml create mode 100644 drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml create mode 100644 drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml create mode 100644 drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml diff --git a/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml new file mode 100644 index 0000000000..8b2fc0f95a --- /dev/null +++ b/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml @@ -0,0 +1,23 @@ +name: lock-unlatch +components: +- id: main + capabilities: + - id: lock + version: 1 + config: + values: + - key: "lock.value" + enabledValues: + - locked + - unlocked + - not fully locked + - id: lockAlarm + version: 1 + - id: remoteControlStatus + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 + categories: + - name: SmartLock diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch.yml new file mode 100644 index 0000000000..b269eed705 --- /dev/null +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch.yml @@ -0,0 +1,29 @@ +name: lock-user-pin-schedule-unlatch +components: +- id: main + capabilities: + - id: lock + version: 1 + config: + values: + - key: "lock.value" + enabledValues: + - locked + - unlocked + - not fully locked + - id: lockAlarm + version: 1 + - id: remoteControlStatus + version: 1 + - id: lockUsers + version: 1 + - id: lockCredentials + version: 1 + - id: lockSchedules + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 + categories: + - name: SmartLock diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml new file mode 100644 index 0000000000..132a4b2339 --- /dev/null +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml @@ -0,0 +1,27 @@ +name: lock-user-pin-unlatch +components: +- id: main + capabilities: + - id: lock + version: 1 + config: + values: + - key: "lock.value" + enabledValues: + - locked + - unlocked + - not fully locked + - id: lockAlarm + version: 1 + - id: remoteControlStatus + version: 1 + - id: lockUsers + version: 1 + - id: lockCredentials + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 + categories: + - name: SmartLock diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml new file mode 100644 index 0000000000..557c586961 --- /dev/null +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml @@ -0,0 +1,27 @@ +name: lock-user-schedule-unlatch +components: +- id: main + capabilities: + - id: lock + version: 1 + config: + values: + - key: "lock.value" + enabledValues: + - locked + - unlocked + - not fully locked + - id: lockAlarm + version: 1 + - id: remoteControlStatus + version: 1 + - id: lockUsers + version: 1 + - id: lockSchedules + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 + categories: + - name: SmartLock diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml new file mode 100644 index 0000000000..8207a94326 --- /dev/null +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml @@ -0,0 +1,25 @@ +name: lock-user-unlatch +components: +- id: main + capabilities: + - id: lock + version: 1 + config: + values: + - key: "lock.value" + enabledValues: + - locked + - unlocked + - not fully locked + - id: lockAlarm + version: 1 + - id: remoteControlStatus + version: 1 + - id: lockUsers + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 + categories: + - name: SmartLock diff --git a/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua b/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua index c4cefed6cf..30e198514f 100644 --- a/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua +++ b/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua @@ -126,6 +126,7 @@ local function do_configure(driver, device) local pin_eps = device:get_endpoints(DoorLock.ID, {feature_bitmap = DoorLock.types.Feature.PIN_CREDENTIAL}) local week_schedule_eps = device:get_endpoints(DoorLock.ID, {feature_bitmap = DoorLock.types.Feature.WEEK_DAY_ACCESS_SCHEDULES}) local year_schedule_eps = device:get_endpoints(DoorLock.ID, {feature_bitmap = DoorLock.types.Feature.YEAR_DAY_ACCESS_SCHEDULES}) + local unbolt_eps = device:get_endpoints(DoorLock.ID, {feature_bitmap = DoorLock.types.Feature.UNBOLT}) local profile_name = "lock" if #user_eps > 0 then @@ -137,6 +138,9 @@ local function do_configure(driver, device) profile_name = profile_name .. "-schedule" end end + if #unbolt_eps > 0 then + profile_name = profile_name .. "-unlatch" + end device.log.info(string.format("Updating device profile to %s.", profile_name)) device:try_update_metadata({profile = profile_name}) end @@ -185,6 +189,7 @@ local function lock_state_handler(driver, device, ib, response) [LockState.NOT_FULLY_LOCKED] = attr.not_fully_locked(), [LockState.LOCKED] = attr.locked(), [LockState.UNLOCKED] = attr.unlocked(), + [LockState.UNLATCHED] = attr.unlatched() } -- The lock state is usually updated in lock_state_handler and lock_op_event_handler, respectively. @@ -357,6 +362,30 @@ local function handle_lock(driver, device, command) end local function handle_unlock(driver, device, command) + local unbolt_eps = device:get_endpoints(DoorLock.ID, {feature_bitmap = DoorLock.types.Feature.UNBOLT}) + local cota_cred = device:get_field(lock_utils.COTA_CRED) + local ep = device:component_to_endpoint(command.component) + + if unbolt_eps then + if cota_cred then + device:send( + DoorLock.server.commands.UnboltDoor(device, ep, cota_cred) + ) + else + device:send(DoorLock.server.commands.UnboltDoor(device, ep)) + end + else + if cota_cred then + device:send( + DoorLock.server.commands.UnlockDoor(device, ep, cota_cred) + ) + else + device:send(DoorLock.server.commands.UnlockDoor(device, ep)) + end + end +end + +local function handle_unlatch(driver, device, command) local ep = device:component_to_endpoint(command.component) local cota_cred = device:get_field(lock_utils.COTA_CRED) if cota_cred then @@ -1568,7 +1597,7 @@ local function lock_op_event_handler(driver, device, ib, response) elseif opType.value == Type.UNLOCK then opType = Lock.unlocked elseif opType.value == Type.UNLATCH then - opType = Lock.locked + opType = Lock.unlatched else return end @@ -1660,6 +1689,7 @@ local new_matter_lock_handler = { [capabilities.lock.ID] = { [capabilities.lock.commands.lock.NAME] = handle_lock, [capabilities.lock.commands.unlock.NAME] = handle_unlock, + [capabilities.lock.commands.unlatch.NAME] = handle_unlatch }, [capabilities.lockUsers.ID] = { [capabilities.lockUsers.commands.addUser.NAME] = handle_add_user, From 17ee10821ea4b2d7cb32304be50f98bd0e7900c6 Mon Sep 17 00:00:00 2001 From: Hunsup Jung Date: Tue, 26 Nov 2024 14:05:10 +0900 Subject: [PATCH 2/4] Add embedded device configure to matter-lock driver for unlatch Signed-off-by: Hunsup Jung --- .../matter-lock/profiles/lock-unlatch.yml | 82 ++++++++++++++++++- .../lock-user-pin-schedule-unlatch.yml | 82 ++++++++++++++++++- .../profiles/lock-user-pin-unlatch.yml | 82 ++++++++++++++++++- .../profiles/lock-user-schedule-unlatch.yml | 65 ++++++++++++++- .../profiles/lock-user-unlatch.yml | 82 ++++++++++++++++++- .../matter-lock/src/new-matter-lock/init.lua | 12 ++- .../src/test/test_new_matter_lock.lua | 9 +- 7 files changed, 404 insertions(+), 10 deletions(-) diff --git a/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml index 8b2fc0f95a..c234c66bf3 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml @@ -1,6 +1,7 @@ name: lock-unlatch components: -- id: main +- label: Main + id: main capabilities: - id: lock version: 1 @@ -10,6 +11,7 @@ components: enabledValues: - locked - unlocked + - unlatched - not fully locked - id: lockAlarm version: 1 @@ -21,3 +23,81 @@ components: version: 1 categories: - name: SmartLock +deviceConfig: + dashboard: + states: + - component: main + capability: lock + version: 1 + actions: + - component: main + capability: lock + version: 1 + detailView: + - component: main + capability: lock + version: 1 + values: + - key: lock.value + alternatives: + - key: locked + type: inactive + value: '{{i18n.attributes.lock.i18n.value.locked.label}}' + - key: unlocked + value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' + - key: unlatched + value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' + - key: unknown + type: inactive + value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' + - key: unlocked with timeout + value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' + - key: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + patch: + - op: add + path: /1 + value: + capability: lock + version: 1 + component: main + label: '{{i18n.commands.unlatch.label}}' + displayType: pushButton + pushButton: + command: unlatch + automation: + conditions: + - component: main + capability: lock + version: 1 + values: + - key: lock.value + alternatives: + - key: locked + type: inactive + value: '{{i18n.attributes.lock.i18n.value.locked.label}}' + - key: unlocked + value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' + - key: unlatched + value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' + - key: unknown + type: inactive + value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' + - key: unlocked with timeout + value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' + - key: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + actions: + - component: main + capability: lock + version: 1 + values: + - key: '{{enumCommands}}' + alternatives: + - key: lock + type: inactive + value: '{{i18n.commands.lock.label}}' + - key: unlock + value: '{{i18n.commands.unlock.label}}' + - key: unlatch + value: '{{i18n.commands.unlatch.label}}' \ No newline at end of file diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch.yml index b269eed705..e6f328dff8 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch.yml @@ -1,6 +1,7 @@ name: lock-user-pin-schedule-unlatch components: -- id: main +- label: Main + id: main capabilities: - id: lock version: 1 @@ -10,6 +11,7 @@ components: enabledValues: - locked - unlocked + - unlatched - not fully locked - id: lockAlarm version: 1 @@ -27,3 +29,81 @@ components: version: 1 categories: - name: SmartLock +deviceConfig: + dashboard: + states: + - component: main + capability: lock + version: 1 + actions: + - component: main + capability: lock + version: 1 + detailView: + - component: main + capability: lock + version: 1 + values: + - key: lock.value + alternatives: + - key: locked + type: inactive + value: '{{i18n.attributes.lock.i18n.value.locked.label}}' + - key: unlocked + value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' + - key: unlatched + value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' + - key: unknown + type: inactive + value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' + - key: unlocked with timeout + value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' + - key: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + patch: + - op: add + path: /1 + value: + capability: lock + version: 1 + component: main + label: '{{i18n.commands.unlatch.label}}' + displayType: pushButton + pushButton: + command: unlatch + automation: + conditions: + - component: main + capability: lock + version: 1 + values: + - key: lock.value + alternatives: + - key: locked + type: inactive + value: '{{i18n.attributes.lock.i18n.value.locked.label}}' + - key: unlocked + value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' + - key: unlatched + value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' + - key: unknown + type: inactive + value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' + - key: unlocked with timeout + value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' + - key: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + actions: + - component: main + capability: lock + version: 1 + values: + - key: '{{enumCommands}}' + alternatives: + - key: lock + type: inactive + value: '{{i18n.commands.lock.label}}' + - key: unlock + value: '{{i18n.commands.unlock.label}}' + - key: unlatch + value: '{{i18n.commands.unlatch.label}}' \ No newline at end of file diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml index 132a4b2339..53cefe16b9 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml @@ -1,6 +1,7 @@ name: lock-user-pin-unlatch components: -- id: main +- label: Main + id: main capabilities: - id: lock version: 1 @@ -10,6 +11,7 @@ components: enabledValues: - locked - unlocked + - unlatched - not fully locked - id: lockAlarm version: 1 @@ -25,3 +27,81 @@ components: version: 1 categories: - name: SmartLock +deviceConfig: + dashboard: + states: + - component: main + capability: lock + version: 1 + actions: + - component: main + capability: lock + version: 1 + detailView: + - component: main + capability: lock + version: 1 + values: + - key: lock.value + alternatives: + - key: locked + type: inactive + value: '{{i18n.attributes.lock.i18n.value.locked.label}}' + - key: unlocked + value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' + - key: unlatched + value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' + - key: unknown + type: inactive + value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' + - key: unlocked with timeout + value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' + - key: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + patch: + - op: add + path: /1 + value: + capability: lock + version: 1 + component: main + label: '{{i18n.commands.unlatch.label}}' + displayType: pushButton + pushButton: + command: unlatch + automation: + conditions: + - component: main + capability: lock + version: 1 + values: + - key: lock.value + alternatives: + - key: locked + type: inactive + value: '{{i18n.attributes.lock.i18n.value.locked.label}}' + - key: unlocked + value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' + - key: unlatched + value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' + - key: unknown + type: inactive + value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' + - key: unlocked with timeout + value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' + - key: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + actions: + - component: main + capability: lock + version: 1 + values: + - key: '{{enumCommands}}' + alternatives: + - key: lock + type: inactive + value: '{{i18n.commands.lock.label}}' + - key: unlock + value: '{{i18n.commands.unlock.label}}' + - key: unlatch + value: '{{i18n.commands.unlatch.label}}' \ No newline at end of file diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml index 557c586961..c31062f882 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml @@ -1,6 +1,7 @@ name: lock-user-schedule-unlatch components: -- id: main +- label: Main + id: main capabilities: - id: lock version: 1 @@ -10,6 +11,7 @@ components: enabledValues: - locked - unlocked + - unlatched - not fully locked - id: lockAlarm version: 1 @@ -25,3 +27,64 @@ components: version: 1 categories: - name: SmartLock +deviceConfig: + dashboard: + states: + - component: main + capability: lock + version: 1 + actions: + - component: main + capability: lock + version: 1 + detailView: + - component: main + capability: lock + version: 1 + patch: + - op: add + path: /1 + value: + capability: lock + version: 1 + component: main + label: '{{i18n.commands.unlatch.label}}' + displayType: pushButton + pushButton: + command: unlatch + automation: + conditions: + - component: main + capability: lock + version: 1 + values: + - key: lock.value + alternatives: + - key: locked + type: inactive + value: '{{i18n.attributes.lock.i18n.value.locked.label}}' + - key: unlocked + value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' + - key: unlatched + value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' + - key: unknown + type: inactive + value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' + - key: unlocked with timeout + value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' + - key: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + actions: + - component: main + capability: lock + version: 1 + values: + - key: '{{enumCommands}}' + alternatives: + - key: lock + type: inactive + value: '{{i18n.commands.lock.label}}' + - key: unlock + value: '{{i18n.commands.unlock.label}}' + - key: unlatch + value: '{{i18n.commands.unlatch.label}}' \ No newline at end of file diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml index 8207a94326..da98ca905c 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml @@ -1,6 +1,7 @@ name: lock-user-unlatch components: -- id: main +- label: Main + id: main capabilities: - id: lock version: 1 @@ -10,6 +11,7 @@ components: enabledValues: - locked - unlocked + - unlatched - not fully locked - id: lockAlarm version: 1 @@ -23,3 +25,81 @@ components: version: 1 categories: - name: SmartLock +deviceConfig: + dashboard: + states: + - component: main + capability: lock + version: 1 + actions: + - component: main + capability: lock + version: 1 + detailView: + - component: main + capability: lock + version: 1 + values: + - key: lock.value + alternatives: + - key: locked + type: inactive + value: '{{i18n.attributes.lock.i18n.value.locked.label}}' + - key: unlocked + value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' + - key: unlatched + value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' + - key: unknown + type: inactive + value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' + - key: unlocked with timeout + value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' + - key: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + patch: + - op: add + path: /1 + value: + capability: lock + version: 1 + component: main + label: '{{i18n.commands.unlatch.label}}' + displayType: pushButton + pushButton: + command: unlatch + automation: + conditions: + - component: main + capability: lock + version: 1 + values: + - key: lock.value + alternatives: + - key: locked + type: inactive + value: '{{i18n.attributes.lock.i18n.value.locked.label}}' + - key: unlocked + value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' + - key: unlatched + value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' + - key: unknown + type: inactive + value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' + - key: unlocked with timeout + value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' + - key: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + actions: + - component: main + capability: lock + version: 1 + values: + - key: '{{enumCommands}}' + alternatives: + - key: lock + type: inactive + value: '{{i18n.commands.lock.label}}' + - key: unlock + value: '{{i18n.commands.unlock.label}}' + - key: unlatch + value: '{{i18n.commands.unlatch.label}}' \ No newline at end of file diff --git a/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua b/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua index 30e198514f..83db28279c 100644 --- a/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua +++ b/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua @@ -140,6 +140,9 @@ local function do_configure(driver, device) end if #unbolt_eps > 0 then profile_name = profile_name .. "-unlatch" + device:emit_event(capabilities.lock.supportedLockCommands({"lock", "unlock", "unlatch"}, {visibility = {displayed = false}})) + else + device:emit_event(capabilities.lock.supportedLockCommands({"lock", "unlock"}, {visibility = {displayed = false}})) end device.log.info(string.format("Updating device profile to %s.", profile_name)) device:try_update_metadata({profile = profile_name}) @@ -218,9 +221,14 @@ local function operating_modes_handler(driver, device, ib, response) [op_type.PASSAGE] = false, } local result = opMode_map[ib.data.value] + local unbolt_eps = device:get_endpoints(DoorLock.ID, {feature_bitmap = DoorLock.types.Feature.UNBOLT}) if result == true then device:emit_event(status("true", {visibility = {displayed = true}})) - device:emit_event(capabilities.lock.supportedLockCommands({"lock", "unlock"}, {visibility = {displayed = false}})) + if #unbolt_eps > 0 then + device:emit_event(capabilities.lock.supportedLockCommands({"lock", "unlock", "unlatch"}, {visibility = {displayed = false}})) + else + device:emit_event(capabilities.lock.supportedLockCommands({"lock", "unlock"}, {visibility = {displayed = false}})) + end elseif result == false then device:emit_event(status("false", {visibility = {displayed = true}})) device:emit_event(capabilities.lock.supportedLockCommands({}, {visibility = {displayed = false}})) @@ -366,7 +374,7 @@ local function handle_unlock(driver, device, command) local cota_cred = device:get_field(lock_utils.COTA_CRED) local ep = device:component_to_endpoint(command.component) - if unbolt_eps then + if #unbolt_eps > 0 then if cota_cred then device:send( DoorLock.server.commands.UnboltDoor(device, ep, cota_cred) diff --git a/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock.lua b/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock.lua index 836ad6fb7e..0bd46b45ef 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock.lua @@ -79,6 +79,9 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive({ mock_device.id, "doConfigure" }) mock_device:expect_metadata_update({ profile = "lock-user-pin" }) mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lock.supportedLockCommands({"lock", "unlock"}, {visibility = {displayed = false}})) + ) end ) @@ -755,7 +758,7 @@ test.register_message_test( direction = "send", message = mock_device:generate_test_message( "main", - capabilities.lock.lock.locked( + capabilities.lock.lock.unlatched( {data = {method = "manual", userIndex = 1}, state_change = true} ) ), @@ -836,7 +839,7 @@ test.register_message_test( direction = "send", message = mock_device:generate_test_message( "main", - capabilities.lock.lock.locked( + capabilities.lock.lock.unlatched( {data = {method = "button", userIndex = 1}, state_change = true} ) ), @@ -917,7 +920,7 @@ test.register_message_test( direction = "send", message = mock_device:generate_test_message( "main", - capabilities.lock.lock.locked( + capabilities.lock.lock.unlatched( {data = {method = "rfid", userIndex = 1}, state_change = true} ) ), From d5b1d4402769a6b583ed18477980b1c6a1550469 Mon Sep 17 00:00:00 2001 From: Hunsup Jung Date: Thu, 28 Nov 2024 15:04:14 +0900 Subject: [PATCH 3/4] Add test file for unlatch Signed-off-by: Hunsup Jung --- .../src/test/test_matter_lock_unlatch.lua | 363 ++++++++++++++++++ .../src/test/test_new_matter_lock.lua | 81 ---- 2 files changed, 363 insertions(+), 81 deletions(-) create mode 100644 drivers/SmartThings/matter-lock/src/test/test_matter_lock_unlatch.lua diff --git a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_unlatch.lua b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_unlatch.lua new file mode 100644 index 0000000000..8d4224f32b --- /dev/null +++ b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_unlatch.lua @@ -0,0 +1,363 @@ +-- Copyright 2023 SmartThings +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +local test = require "integration_test" +local capabilities = require "st.capabilities" +test.add_package_capability("lockAlarm.yml") +local t_utils = require "integration_test.utils" +local clusters = require "st.matter.clusters" +local DoorLock = clusters.DoorLock +local types = DoorLock.types + +local mock_device = test.mock_device.build_test_matter_device({ + profile = t_utils.get_profile_definition("lock-unlatch.yml"), + manufacturer_info = { + vendor_id = 0x115f, + product_id = 0x2802, + }, + endpoints = { + { + endpoint_id = 0, + clusters = { + { cluster_id = clusters.BasicInformation.ID, cluster_type = "SERVER" }, + }, + device_types = { + { device_type_id = 0x0016, device_type_revision = 1 } -- RootNode + } + }, + { + endpoint_id = 1, + clusters = { + { + cluster_id = DoorLock.ID, + cluster_type = "SERVER", + cluster_revision = 1, + feature_map = 0x1000, -- UNBOLT + } + }, + device_types = { + { device_type_id = 0x000A, device_type_revision = 1 } -- Door Lock + } + } + } +}) + +local function test_init() + local subscribe_request = DoorLock.attributes.LockState:subscribe(mock_device) + subscribe_request:merge(DoorLock.attributes.OperatingMode:subscribe(mock_device)) + subscribe_request:merge(DoorLock.events.LockOperation:subscribe(mock_device)) + subscribe_request:merge(DoorLock.events.DoorLockAlarm:subscribe(mock_device)) + test.socket["matter"]:__expect_send({mock_device.id, subscribe_request}) + test.mock_device.add_test_device(mock_device) +end + +test.set_test_init_function(test_init) + +test.register_coroutine_test( + "Assert profile applied over doConfigure", + function() + test.socket.device_lifecycle:__queue_receive({ mock_device.id, "doConfigure" }) + mock_device:expect_metadata_update({ profile = "lock-unlatch" }) + mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lock.supportedLockCommands({"lock", "unlock", "unlatch"}, {visibility = {displayed = false}})) + ) + end +) + +test.register_coroutine_test( + "Handle received OperatingMode(Normal, Vacation) from Matter device.", + function() + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.attributes.OperatingMode:build_test_report_data( + mock_device, 1, DoorLock.attributes.OperatingMode.NORMAL + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.remoteControlStatus.remoteControlEnabled("true", {visibility = {displayed = true}})) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lock.supportedLockCommands({"lock", "unlock", "unlatch"}, {visibility = {displayed = false}})) + ) + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.attributes.OperatingMode:build_test_report_data( + mock_device, 1, DoorLock.attributes.OperatingMode.VACATION + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.remoteControlStatus.remoteControlEnabled("true", {visibility = {displayed = true}})) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lock.supportedLockCommands({"lock", "unlock", "unlatch"}, {visibility = {displayed = false}})) + ) + end +) + +test.register_coroutine_test( + "Handle received OperatingMode(Privacy, No Remote Lock UnLock, Passage) from Matter device.", + function() + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.attributes.OperatingMode:build_test_report_data( + mock_device, 1, DoorLock.attributes.OperatingMode.PRIVACY + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.remoteControlStatus.remoteControlEnabled("false", {visibility = {displayed = true}})) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lock.supportedLockCommands({}, {visibility = {displayed = false}})) + ) + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.attributes.OperatingMode:build_test_report_data( + mock_device, 1, DoorLock.attributes.OperatingMode.NO_REMOTE_LOCK_UNLOCK + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.remoteControlStatus.remoteControlEnabled("false", {visibility = {displayed = true}})) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lock.supportedLockCommands({}, {visibility = {displayed = false}})) + ) + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.attributes.OperatingMode:build_test_report_data( + mock_device, 1, DoorLock.attributes.OperatingMode.PASSAGE + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.remoteControlStatus.remoteControlEnabled("false", {visibility = {displayed = true}})) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lock.supportedLockCommands({}, {visibility = {displayed = false}})) + ) + end +) + +test.register_message_test( + "Handle Lock command received from SmartThings.", { + { + channel = "capability", + direction = "receive", + message = { + mock_device.id, + {capability = "lock", component = "main", command = "lock", args = {}}, + }, + }, + { + channel = "matter", + direction = "send", + message = {mock_device.id, DoorLock.server.commands.LockDoor(mock_device, 1)}, + }, + } +) + +test.register_message_test( + "Handle Unlock command received from SmartThings.", { + { + channel = "capability", + direction = "receive", + message = { + mock_device.id, + {capability = "lock", component = "main", command = "unlock", args = {}}, + }, + }, + { + channel = "matter", + direction = "send", + message = { + mock_device.id, + DoorLock.server.commands.UnboltDoor(mock_device, 1), + }, + }, + } +) + +test.register_message_test( + "Handle Unlatch command received from SmartThings.", { + { + channel = "capability", + direction = "receive", + message = { + mock_device.id, + {capability = "lock", component = "main", command = "unlatch", args = {}}, + }, + }, + { + channel = "matter", + direction = "send", + message = { + mock_device.id, + DoorLock.server.commands.UnlockDoor(mock_device, 1), + }, + }, + } +) + +test.register_coroutine_test( + "Handle received LockState.LOCKED from Matter device.", + function() + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.attributes.LockState:build_test_report_data( + mock_device, 1, DoorLock.attributes.LockState.LOCKED + ), + } + ) + test.timer.__create_and_queue_test_time_advance_timer(1, "oneshot") + test.mock_time.advance_time(1) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lock.lock.locked()) + ) + end +) + +test.register_coroutine_test( + "Handle received LockState.UNLOCKED from Matter device.", + function() + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.attributes.LockState:build_test_report_data( + mock_device, 1, DoorLock.attributes.LockState.UNLOCKED + ), + } + ) + test.timer.__create_and_queue_test_time_advance_timer(1, "oneshot") + test.mock_time.advance_time(1) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lock.lock.unlocked()) + ) + end +) + +test.register_coroutine_test( + "Handle received LockState.UNLATCHED from Matter device.", + function() + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.attributes.LockState:build_test_report_data( + mock_device, 1, DoorLock.attributes.LockState.UNLATCHED + ), + } + ) + test.timer.__create_and_queue_test_time_advance_timer(1, "oneshot") + test.mock_time.advance_time(1) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lock.lock.unlatched()) + ) + end +) + +test.register_message_test( + "Handle Lock Operation event from Matter device.", { + { + channel = "matter", + direction = "receive", + message = { + mock_device.id, + DoorLock.events.LockOperation:build_test_event_report( + mock_device, 1, + { + lock_operation_type = types.LockOperationTypeEnum.UNLATCH, + operation_source = types.OperationSourceEnum.MANUAL, + user_index = 1, + fabric_index = 1, + source_node = 1 + } + ), + }, + }, + { + channel = "capability", + direction = "send", + message = mock_device:generate_test_message( + "main", + capabilities.lock.lock.unlatched( + {data = {method = "manual", userIndex = 1}, state_change = true} + ) + ), + }, + { + channel = "matter", + direction = "receive", + message = { + mock_device.id, + DoorLock.events.LockOperation:build_test_event_report( + mock_device, 1, + { + lock_operation_type = types.LockOperationTypeEnum.UNLATCH, + operation_source = types.OperationSourceEnum.BUTTON, + user_index = 1, + fabric_index = 1, + source_node = 1 + } + ), + }, + }, + { + channel = "capability", + direction = "send", + message = mock_device:generate_test_message( + "main", + capabilities.lock.lock.unlatched( + {data = {method = "button", userIndex = 1}, state_change = true} + ) + ), + }, + { + channel = "matter", + direction = "receive", + message = { + mock_device.id, + DoorLock.events.LockOperation:build_test_event_report( + mock_device, 1, + { + lock_operation_type = types.LockOperationTypeEnum.UNLATCH, + operation_source = types.OperationSourceEnum.RFID, + user_index = 1, + fabric_index = 1, + source_node = 1 + } + ), + }, + }, + { + channel = "capability", + direction = "send", + message = mock_device:generate_test_message( + "main", + capabilities.lock.lock.unlatched( + {data = {method = "rfid", userIndex = 1}, state_change = true} + ) + ), + } + } +) +test.run_registered_tests() diff --git a/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock.lua b/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock.lua index 0bd46b45ef..7d8e92eeeb 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock.lua @@ -736,33 +736,6 @@ test.register_message_test( ) ), }, - { - channel = "matter", - direction = "receive", - message = { - mock_device.id, - DoorLock.events.LockOperation:build_test_event_report( - mock_device, 1, - { - lock_operation_type = types.LockOperationTypeEnum.UNLATCH, - operation_source = types.OperationSourceEnum.MANUAL, - user_index = 1, - fabric_index = 1, - source_node = 1 - } - ), - }, - }, - { - channel = "capability", - direction = "send", - message = mock_device:generate_test_message( - "main", - capabilities.lock.lock.unlatched( - {data = {method = "manual", userIndex = 1}, state_change = true} - ) - ), - }, { channel = "matter", direction = "receive", @@ -817,33 +790,6 @@ test.register_message_test( ) ), }, - { - channel = "matter", - direction = "receive", - message = { - mock_device.id, - DoorLock.events.LockOperation:build_test_event_report( - mock_device, 1, - { - lock_operation_type = types.LockOperationTypeEnum.UNLATCH, - operation_source = types.OperationSourceEnum.BUTTON, - user_index = 1, - fabric_index = 1, - source_node = 1 - } - ), - }, - }, - { - channel = "capability", - direction = "send", - message = mock_device:generate_test_message( - "main", - capabilities.lock.lock.unlatched( - {data = {method = "button", userIndex = 1}, state_change = true} - ) - ), - }, { channel = "matter", direction = "receive", @@ -898,33 +844,6 @@ test.register_message_test( ) ), }, - { - channel = "matter", - direction = "receive", - message = { - mock_device.id, - DoorLock.events.LockOperation:build_test_event_report( - mock_device, 1, - { - lock_operation_type = types.LockOperationTypeEnum.UNLATCH, - operation_source = types.OperationSourceEnum.RFID, - user_index = 1, - fabric_index = 1, - source_node = 1 - } - ), - }, - }, - { - channel = "capability", - direction = "send", - message = mock_device:generate_test_message( - "main", - capabilities.lock.lock.unlatched( - {data = {method = "rfid", userIndex = 1}, state_change = true} - ) - ), - }, { channel = "matter", direction = "receive", From 31a85c3f94de92da8f490eb5390ca6f6b8247585 Mon Sep 17 00:00:00 2001 From: Hunsup Jung Date: Wed, 4 Dec 2024 10:59:21 +0900 Subject: [PATCH 4/4] Fix a typo and unnecessary alternative keys Signed-off-by: Hunsup Jung --- .../matter-lock/profiles/lock-unlatch.yml | 10 ---------- .../profiles/lock-user-pin-schedule-unlatch.yml | 10 ---------- .../profiles/lock-user-pin-unlatch.yml | 10 ---------- .../profiles/lock-user-schedule-unlatch.yml | 17 ++++++++++++----- .../matter-lock/profiles/lock-user-unlatch.yml | 10 ---------- .../src/test/test_matter_lock_unlatch.lua | 2 +- 6 files changed, 13 insertions(+), 46 deletions(-) diff --git a/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml index c234c66bf3..f479990ddf 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml @@ -47,11 +47,6 @@ deviceConfig: value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' - key: unlatched value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' - - key: unknown - type: inactive - value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' - - key: unlocked with timeout - value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' - key: not fully locked value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' patch: @@ -80,11 +75,6 @@ deviceConfig: value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' - key: unlatched value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' - - key: unknown - type: inactive - value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' - - key: unlocked with timeout - value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' - key: not fully locked value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' actions: diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch.yml index e6f328dff8..7ec2fa7518 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch.yml @@ -53,11 +53,6 @@ deviceConfig: value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' - key: unlatched value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' - - key: unknown - type: inactive - value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' - - key: unlocked with timeout - value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' - key: not fully locked value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' patch: @@ -86,11 +81,6 @@ deviceConfig: value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' - key: unlatched value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' - - key: unknown - type: inactive - value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' - - key: unlocked with timeout - value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' - key: not fully locked value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' actions: diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml index 53cefe16b9..e27a6bc0f4 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml @@ -51,11 +51,6 @@ deviceConfig: value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' - key: unlatched value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' - - key: unknown - type: inactive - value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' - - key: unlocked with timeout - value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' - key: not fully locked value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' patch: @@ -84,11 +79,6 @@ deviceConfig: value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' - key: unlatched value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' - - key: unknown - type: inactive - value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' - - key: unlocked with timeout - value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' - key: not fully locked value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' actions: diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml index c31062f882..10669ccaeb 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml @@ -41,6 +41,18 @@ deviceConfig: - component: main capability: lock version: 1 + values: + - key: lock.value + alternatives: + - key: locked + type: inactive + value: '{{i18n.attributes.lock.i18n.value.locked.label}}' + - key: unlocked + value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' + - key: unlatched + value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' + - key: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' patch: - op: add path: /1 @@ -67,11 +79,6 @@ deviceConfig: value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' - key: unlatched value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' - - key: unknown - type: inactive - value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' - - key: unlocked with timeout - value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' - key: not fully locked value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' actions: diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml index da98ca905c..eaaf37ae63 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml @@ -49,11 +49,6 @@ deviceConfig: value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' - key: unlatched value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' - - key: unknown - type: inactive - value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' - - key: unlocked with timeout - value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' - key: not fully locked value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' patch: @@ -82,11 +77,6 @@ deviceConfig: value: '{{i18n.attributes.lock.i18n.value.unlocked.label}}' - key: unlatched value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' - - key: unknown - type: inactive - value: '{{i18n.attributes.lock.i18n.value.unknown.label}}' - - key: unlocked with timeout - value: '{{i18n.attributes.lock.i18n.value.unlocked with timeout.label}}' - key: not fully locked value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' actions: diff --git a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_unlatch.lua b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_unlatch.lua index 8d4224f32b..2e390f4d34 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_unlatch.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_unlatch.lua @@ -276,7 +276,7 @@ test.register_coroutine_test( ) test.register_message_test( - "Handle Lock Operation event from Matter device.", { + "Handle Unlatch Operation event from Matter device.", { { channel = "matter", direction = "receive",