From bb2ccafbd889f239e4d182a9498e8610ed9c7974 Mon Sep 17 00:00:00 2001 From: Hunsup Jung Date: Mon, 10 Mar 2025 20:52:46 +0900 Subject: [PATCH] Update new-matter-lock driver Signed-off-by: Hunsup Jung --- .../matter-lock/profiles/lock-battery.yml | 25 ++++ .../profiles/lock-batteryLevel.yml | 25 ++++ .../profiles/lock-unlatch-battery.yml | 120 +++++++++++++++++ .../profiles/lock-unlatch-batteryLevel.yml | 120 +++++++++++++++++ .../matter-lock/profiles/lock-unlatch.yml | 25 +++- ...lock-user-pin-schedule-unlatch-battery.yml | 126 ++++++++++++++++++ ...user-pin-schedule-unlatch-batteryLevel.yml | 126 ++++++++++++++++++ .../lock-user-pin-schedule-unlatch.yml | 25 +++- .../profiles/lock-user-pin-unlatch.yml | 25 +++- .../profiles/lock-user-schedule-unlatch.yml | 13 +- .../profiles/lock-user-unlatch.yml | 30 ++++- .../matter-lock/src/new-matter-lock/init.lua | 4 +- 12 files changed, 646 insertions(+), 18 deletions(-) create mode 100644 drivers/SmartThings/matter-lock/profiles/lock-battery.yml create mode 100644 drivers/SmartThings/matter-lock/profiles/lock-batteryLevel.yml create mode 100644 drivers/SmartThings/matter-lock/profiles/lock-unlatch-battery.yml create mode 100644 drivers/SmartThings/matter-lock/profiles/lock-unlatch-batteryLevel.yml create mode 100644 drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch-battery.yml create mode 100644 drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch-batteryLevel.yml diff --git a/drivers/SmartThings/matter-lock/profiles/lock-battery.yml b/drivers/SmartThings/matter-lock/profiles/lock-battery.yml new file mode 100644 index 0000000000..e4e7229b40 --- /dev/null +++ b/drivers/SmartThings/matter-lock/profiles/lock-battery.yml @@ -0,0 +1,25 @@ +name: lock-battery +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: battery + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 + categories: + - name: SmartLock diff --git a/drivers/SmartThings/matter-lock/profiles/lock-batteryLevel.yml b/drivers/SmartThings/matter-lock/profiles/lock-batteryLevel.yml new file mode 100644 index 0000000000..1286fc4a53 --- /dev/null +++ b/drivers/SmartThings/matter-lock/profiles/lock-batteryLevel.yml @@ -0,0 +1,25 @@ +name: lock-batteryLevel +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: batteryLevel + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 + categories: + - name: SmartLock diff --git a/drivers/SmartThings/matter-lock/profiles/lock-unlatch-battery.yml b/drivers/SmartThings/matter-lock/profiles/lock-unlatch-battery.yml new file mode 100644 index 0000000000..c0837439dd --- /dev/null +++ b/drivers/SmartThings/matter-lock/profiles/lock-unlatch-battery.yml @@ -0,0 +1,120 @@ +name: lock-unlatch-battery +components: +- id: main + capabilities: + - id: lock + version: 1 + config: + values: + - key: "lock.value" + enabledValues: + - locked + - unlocked + - unlatched + - not fully locked + - id: lockAlarm + version: 1 + - id: remoteControlStatus + version: 1 + - id: battery + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 + categories: + - name: SmartLock +deviceConfig: + dashboard: + states: + - component: main + capability: lock + version: 1 + actions: + - component: main + capability: lock + version: 1 + visibleCondition: { + "capability": "lock", + "version": 1, + "component": "main", + "value": "lock.value", + "operator": "DOES_NOT_EQUAL", + "operand": "unlatched" + } + 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: 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 + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 + - component: main + capability: battery + version: 1 + 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: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 + - component: main + capability: battery + version: 1 + 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}}' diff --git a/drivers/SmartThings/matter-lock/profiles/lock-unlatch-batteryLevel.yml b/drivers/SmartThings/matter-lock/profiles/lock-unlatch-batteryLevel.yml new file mode 100644 index 0000000000..668ec11a6d --- /dev/null +++ b/drivers/SmartThings/matter-lock/profiles/lock-unlatch-batteryLevel.yml @@ -0,0 +1,120 @@ +name: lock-unlatch-batteryLevel +components: +- id: main + capabilities: + - id: lock + version: 1 + config: + values: + - key: "lock.value" + enabledValues: + - locked + - unlocked + - unlatched + - not fully locked + - id: lockAlarm + version: 1 + - id: remoteControlStatus + version: 1 + - id: batteryLevel + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 + categories: + - name: SmartLock +deviceConfig: + dashboard: + states: + - component: main + capability: lock + version: 1 + actions: + - component: main + capability: lock + version: 1 + visibleCondition: { + "capability": "lock", + "version": 1, + "component": "main", + "value": "lock.value", + "operator": "DOES_NOT_EQUAL", + "operand": "unlatched" + } + 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: 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 + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 + - component: main + capability: batteryLevel + version: 1 + 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: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 + - component: main + capability: batteryLevel + version: 1 + 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}}' diff --git a/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml index f479990ddf..182963be89 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-unlatch.yml @@ -1,7 +1,6 @@ name: lock-unlatch components: -- label: Main - id: main +- id: main capabilities: - id: lock version: 1 @@ -33,6 +32,14 @@ deviceConfig: - component: main capability: lock version: 1 + visibleCondition: { + "capability": "lock", + "version": 1, + "component": "main", + "value": "lock.value", + "operator": "DOES_NOT_EQUAL", + "operand": "unlatched" + } detailView: - component: main capability: lock @@ -60,6 +67,12 @@ deviceConfig: displayType: pushButton pushButton: command: unlatch + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 automation: conditions: - component: main @@ -77,6 +90,12 @@ deviceConfig: value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' - key: not fully locked value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 actions: - component: main capability: lock @@ -90,4 +109,4 @@ deviceConfig: - key: unlock value: '{{i18n.commands.unlock.label}}' - key: unlatch - value: '{{i18n.commands.unlatch.label}}' \ No newline at end of file + value: '{{i18n.commands.unlatch.label}}' diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch-battery.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch-battery.yml new file mode 100644 index 0000000000..1568f345b1 --- /dev/null +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch-battery.yml @@ -0,0 +1,126 @@ +name: lock-user-pin-schedule-unlatch-battery +components: +- id: main + capabilities: + - id: lock + version: 1 + config: + values: + - key: "lock.value" + enabledValues: + - locked + - unlocked + - unlatched + - not fully locked + - id: lockAlarm + version: 1 + - id: remoteControlStatus + version: 1 + - id: lockUsers + version: 1 + - id: lockCredentials + version: 1 + - id: lockSchedules + version: 1 + - id: battery + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 + categories: + - name: SmartLock +deviceConfig: + dashboard: + states: + - component: main + capability: lock + version: 1 + actions: + - component: main + capability: lock + version: 1 + visibleCondition: { + "capability": "lock", + "version": 1, + "component": "main", + "value": "lock.value", + "operator": "DOES_NOT_EQUAL", + "operand": "unlatched" + } + 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: 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 + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 + - component: main + capability: battery + version: 1 + 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: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 + - component: main + capability: battery + version: 1 + 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}}' diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch-batteryLevel.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch-batteryLevel.yml new file mode 100644 index 0000000000..5973f1257c --- /dev/null +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-schedule-unlatch-batteryLevel.yml @@ -0,0 +1,126 @@ +name: lock-user-pin-schedule-unlatch-batteryLevel +components: +- id: main + capabilities: + - id: lock + version: 1 + config: + values: + - key: "lock.value" + enabledValues: + - locked + - unlocked + - unlatched + - not fully locked + - id: lockAlarm + version: 1 + - id: remoteControlStatus + version: 1 + - id: lockUsers + version: 1 + - id: lockCredentials + version: 1 + - id: lockSchedules + version: 1 + - id: batteryLevel + version: 1 + - id: firmwareUpdate + version: 1 + - id: refresh + version: 1 + categories: + - name: SmartLock +deviceConfig: + dashboard: + states: + - component: main + capability: lock + version: 1 + actions: + - component: main + capability: lock + version: 1 + visibleCondition: { + "capability": "lock", + "version": 1, + "component": "main", + "value": "lock.value", + "operator": "DOES_NOT_EQUAL", + "operand": "unlatched" + } + 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: 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 + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 + - component: main + capability: batteryLevel + version: 1 + 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: not fully locked + value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 + - component: main + capability: batteryLevel + version: 1 + 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}}' 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 7ec2fa7518..648cebe133 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,7 +1,6 @@ name: lock-user-pin-schedule-unlatch components: -- label: Main - id: main +- id: main capabilities: - id: lock version: 1 @@ -39,6 +38,14 @@ deviceConfig: - component: main capability: lock version: 1 + visibleCondition: { + "capability": "lock", + "version": 1, + "component": "main", + "value": "lock.value", + "operator": "DOES_NOT_EQUAL", + "operand": "unlatched" + } detailView: - component: main capability: lock @@ -66,6 +73,12 @@ deviceConfig: displayType: pushButton pushButton: command: unlatch + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 automation: conditions: - component: main @@ -83,6 +96,12 @@ deviceConfig: value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' - key: not fully locked value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 actions: - component: main capability: lock @@ -96,4 +115,4 @@ deviceConfig: - key: unlock value: '{{i18n.commands.unlock.label}}' - key: unlatch - value: '{{i18n.commands.unlatch.label}}' \ No newline at end of file + value: '{{i18n.commands.unlatch.label}}' 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 e27a6bc0f4..d65fda144b 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-pin-unlatch.yml @@ -1,7 +1,6 @@ name: lock-user-pin-unlatch components: -- label: Main - id: main +- id: main capabilities: - id: lock version: 1 @@ -37,6 +36,14 @@ deviceConfig: - component: main capability: lock version: 1 + visibleCondition: { + "capability": "lock", + "version": 1, + "component": "main", + "value": "lock.value", + "operator": "DOES_NOT_EQUAL", + "operand": "unlatched" + } detailView: - component: main capability: lock @@ -64,6 +71,12 @@ deviceConfig: displayType: pushButton pushButton: command: unlatch + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 automation: conditions: - component: main @@ -81,6 +94,12 @@ deviceConfig: value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' - key: not fully locked value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 actions: - component: main capability: lock @@ -94,4 +113,4 @@ deviceConfig: - key: unlock value: '{{i18n.commands.unlock.label}}' - key: unlatch - value: '{{i18n.commands.unlatch.label}}' \ No newline at end of file + value: '{{i18n.commands.unlatch.label}}' 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 10669ccaeb..2b8153ce1d 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-schedule-unlatch.yml @@ -1,7 +1,6 @@ name: lock-user-schedule-unlatch components: -- label: Main - id: main +- id: main capabilities: - id: lock version: 1 @@ -37,6 +36,14 @@ deviceConfig: - component: main capability: lock version: 1 + visibleCondition: { + "capability": "lock", + "version": 1, + "component": "main", + "value": "lock.value", + "operator": "DOES_NOT_EQUAL", + "operand": "unlatched" + } detailView: - component: main capability: lock @@ -94,4 +101,4 @@ deviceConfig: - key: unlock value: '{{i18n.commands.unlock.label}}' - key: unlatch - value: '{{i18n.commands.unlatch.label}}' \ No newline at end of file + value: '{{i18n.commands.unlatch.label}}' diff --git a/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml b/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml index eaaf37ae63..f4760d25ee 100644 --- a/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml +++ b/drivers/SmartThings/matter-lock/profiles/lock-user-unlatch.yml @@ -1,7 +1,6 @@ name: lock-user-unlatch components: -- label: Main - id: main +- id: main capabilities: - id: lock version: 1 @@ -35,6 +34,14 @@ deviceConfig: - component: main capability: lock version: 1 + visibleCondition: { + "capability": "lock", + "version": 1, + "component": "main", + "value": "lock.value", + "operator": "DOES_NOT_EQUAL", + "operand": "unlatched" + } detailView: - component: main capability: lock @@ -62,6 +69,15 @@ deviceConfig: displayType: pushButton pushButton: command: unlatch + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 + - component: main + capability: batteryLevel + version: 1 automation: conditions: - component: main @@ -79,7 +95,13 @@ deviceConfig: value: '{{i18n.attributes.lock.i18n.value.unlatched.label}}' - key: not fully locked value: '{{i18n.attributes.lock.i18n.value.not fully locked.label}}' - actions: + - component: main + capability: lockAlarm + version: 1 + - component: main + capability: remoteControlStatus + version: 1 + actions: - component: main capability: lock version: 1 @@ -92,4 +114,4 @@ deviceConfig: - key: unlock value: '{{i18n.commands.unlock.label}}' - key: unlatch - value: '{{i18n.commands.unlatch.label}}' \ No newline at end of file + value: '{{i18n.commands.unlatch.label}}' 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 65e6e03941..1208b74b5b 100644 --- a/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua +++ b/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua @@ -164,7 +164,7 @@ local function do_configure(driver, device) req:merge(clusters.PowerSource.attributes.AttributeList:read()) device:send(req) else - device.log.info(string.format("Updating device profile to %s.", profile_name)) + device.log.info_with({hub_logs=true}, string.format("Updating device profile to %s.", profile_name)) device:try_update_metadata({profile = profile_name}) end end @@ -396,7 +396,7 @@ local function handle_power_source_attribute_list(driver, device, ib, response) elseif support_battery_level then profile_name = profile_name .. "-batteryLevel" end - device.log.info(string.format("Updating device profile to %s.", profile_name)) + device.log.info_with({hub_logs=true}, string.format("Updating device profile to %s.", profile_name)) device:try_update_metadata({profile = profile_name}) end end