Skip to content

Commit 73d9796

Browse files
committed
Fixing the Hub Error Log Related to Preference STSE Capability
1 parent b53f7bb commit 73d9796

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

drivers/SmartThings/zigbee-window-treatment/src/aqara/curtain-driver-e1/init.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ local PRIVATE_CURTAIN_LOCKING_SETTING_ATTRIBUTE_ID = 0x0427
2929
local PRIVATE_CURTAIN_LOCKING_STATUS_ATTRIBUTE_ID = 0x0428
3030

3131
local initializedStateWithGuide = capabilities["stse.initializedStateWithGuide"]
32-
local reverseCurtainDirection = capabilities["stse.reverseCurtainDirection"]
32+
local reverseCurtainDirection = "stse.reverseCurtainDirection"
3333
local hookLockState = capabilities["stse.hookLockState"]
3434
local chargingState = capabilities["stse.chargingState"]
35-
local softTouch = capabilities["stse.softTouch"]
35+
local softTouch = "stse.softTouch"
3636
local hookUnlockCommandName = "hookUnlock"
3737
local hookLockCommandName = "hookLock"
3838

@@ -82,20 +82,20 @@ end
8282

8383
local function device_info_changed(driver, device, event, args)
8484
if device.preferences ~= nil then
85-
local reverseCurtainDirectionPrefValue = device.preferences[reverseCurtainDirection.ID]
86-
local softTouchPrefValue = device.preferences[softTouch.ID]
85+
local reverseCurtainDirectionPrefValue = device.preferences[reverseCurtainDirection]
86+
local softTouchPrefValue = device.preferences[softTouch]
8787

8888
-- reverse direction
8989
if reverseCurtainDirectionPrefValue ~= nil and
90-
reverseCurtainDirectionPrefValue ~= args.old_st_store.preferences[reverseCurtainDirection.ID] then
90+
reverseCurtainDirectionPrefValue ~= args.old_st_store.preferences[reverseCurtainDirection] then
9191
local raw_value = reverseCurtainDirectionPrefValue and 0x01 or 0x00
9292
device:send(aqara_utils.custom_write_attribute(device, WindowCovering.ID, WindowCovering.attributes.Mode.ID,
9393
data_types.Bitmap8, raw_value, nil))
9494
end
9595

9696
-- soft touch
9797
if softTouchPrefValue ~= nil and
98-
softTouchPrefValue ~= args.old_st_store.preferences[softTouch.ID] then
98+
softTouchPrefValue ~= args.old_st_store.preferences[softTouch] then
9999
device:send(cluster_base.write_manufacturer_specific_attribute(device,
100100
aqara_utils.PRIVATE_CLUSTER_ID, PRIVATE_CURTAIN_MANUAL_ATTRIBUTE_ID, aqara_utils.MFG_CODE, data_types.Boolean, (not softTouchPrefValue)))
101101
end

drivers/SmartThings/zigbee-window-treatment/src/aqara/init.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ local AnalogOutput = clusters.AnalogOutput
1111
local Groups = clusters.Groups
1212

1313
local deviceInitialization = capabilities["stse.deviceInitialization"]
14-
local reverseCurtainDirection = capabilities["stse.reverseCurtainDirection"]
15-
local softTouch = capabilities["stse.softTouch"]
14+
local reverseCurtainDirection = "stse.reverseCurtainDirection"
15+
local softTouch = "stse.softTouch"
1616
local setInitializedStateCommandName = "setInitializedState"
1717

1818
local INIT_STATE = "initState"
@@ -133,12 +133,12 @@ end
133133

134134
local function device_info_changed(driver, device, event, args)
135135
if device.preferences ~= nil then
136-
local reverseCurtainDirectionPrefValue = device.preferences[reverseCurtainDirection.ID]
137-
local softTouchPrefValue = device.preferences[softTouch.ID]
136+
local reverseCurtainDirectionPrefValue = device.preferences[reverseCurtainDirection]
137+
local softTouchPrefValue = device.preferences[softTouch]
138138

139139
-- reverse direction
140140
if reverseCurtainDirectionPrefValue ~= nil and
141-
reverseCurtainDirectionPrefValue ~= args.old_st_store.preferences[reverseCurtainDirection.ID] then
141+
reverseCurtainDirectionPrefValue ~= args.old_st_store.preferences[reverseCurtainDirection] then
142142
local raw_value = reverseCurtainDirectionPrefValue and aqara_utils.PREF_REVERSE_ON or aqara_utils.PREF_REVERSE_OFF
143143
device:send(cluster_base.write_manufacturer_specific_attribute(device, Basic.ID, aqara_utils.PREF_ATTRIBUTE_ID,
144144
aqara_utils.MFG_CODE, data_types.CharString, raw_value))
@@ -152,7 +152,7 @@ local function device_info_changed(driver, device, event, args)
152152

153153
-- soft touch
154154
if softTouchPrefValue ~= nil and
155-
softTouchPrefValue ~= args.old_st_store.preferences[softTouch.ID] then
155+
softTouchPrefValue ~= args.old_st_store.preferences[softTouch] then
156156
local raw_value = softTouchPrefValue and PREF_SOFT_TOUCH_ON or PREF_SOFT_TOUCH_OFF
157157
device:send(cluster_base.write_manufacturer_specific_attribute(device, Basic.ID, aqara_utils.PREF_ATTRIBUTE_ID,
158158
aqara_utils.MFG_CODE, data_types.CharString, raw_value))

drivers/SmartThings/zigbee-window-treatment/src/aqara/roller-shade/init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ local Basic = clusters.Basic
1010
local WindowCovering = clusters.WindowCovering
1111

1212
local initializedStateWithGuide = capabilities["stse.initializedStateWithGuide"]
13-
local reverseRollerShadeDir = capabilities["stse.reverseRollerShadeDir"]
13+
local reverseRollerShadeDir = "stse.reverseRollerShadeDir"
1414
local shadeRotateState = capabilities["stse.shadeRotateState"]
1515
local setRotateStateCommandName = "setRotateState"
1616

@@ -82,9 +82,9 @@ end
8282

8383
local function device_info_changed(driver, device, event, args)
8484
if device.preferences ~= nil then
85-
local reverseRollerShadeDirPrefValue = device.preferences[reverseRollerShadeDir.ID]
85+
local reverseRollerShadeDirPrefValue = device.preferences[reverseRollerShadeDir]
8686
if reverseRollerShadeDirPrefValue ~= nil and
87-
reverseRollerShadeDirPrefValue ~= args.old_st_store.preferences[reverseRollerShadeDir.ID] then
87+
reverseRollerShadeDirPrefValue ~= args.old_st_store.preferences[reverseRollerShadeDir] then
8888
local raw_value = reverseRollerShadeDirPrefValue and aqara_utils.PREF_REVERSE_ON or aqara_utils.PREF_REVERSE_OFF
8989
device:send(cluster_base.write_manufacturer_specific_attribute(device, Basic.ID, aqara_utils.PREF_ATTRIBUTE_ID,
9090
aqara_utils.MFG_CODE, data_types.CharString, raw_value))

0 commit comments

Comments
 (0)