Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local test = require "integration_test"
local capabilities = require "st.capabilities"
local t_utils = require "integration_test.utils"
local utils = require "st.utils"
local dkjson = require "dkjson"
local json = require "st.json"

local clusters = require "st.matter.generated.zap_clusters"
local button_attr = capabilities.button.button
Expand Down Expand Up @@ -99,7 +99,7 @@ local function test_init()
-- simulate the profile change update taking affect and the device info changing
local device_info_copy = utils.deep_copy(mock_device.raw_st_data)
device_info_copy.profile.id = "4-buttons-battery"
local device_info_json = dkjson.encode(device_info_copy)
local device_info_json = json.encode(device_info_copy)
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "infoChanged", device_info_json })
test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.supportedButtonValues({"pushed"}, {visibility = {displayed = false}})))
test.socket.capability:__expect_send(mock_device:generate_test_message("main", button_attr.pushed({state_change = false})))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local test = require "integration_test"
local capabilities = require "st.capabilities"
local t_utils = require "integration_test.utils"
local utils = require "st.utils"
local dkjson = require "dkjson"
local json = require "st.json"

local clusters = require "st.matter.clusters"

Expand Down Expand Up @@ -246,7 +246,7 @@ local function test_aqs_device_type_update_modular_profile(generic_mock_device,
generic_mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" })
local device_info_copy = utils.deep_copy(generic_mock_device.raw_st_data)
device_info_copy.profile.id = "aqs-modular"
local device_info_json = dkjson.encode(device_info_copy)
local device_info_json = json.encode(device_info_copy)
test.socket.device_lifecycle:__queue_receive({ generic_mock_device.id, "infoChanged", device_info_json })
test.socket.matter:__expect_send({generic_mock_device.id, subscribe_request})
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local test = require "integration_test"
local t_utils = require "integration_test.utils"
local capabilities = require "st.capabilities"
local utils = require "st.utils"
local dkjson = require "dkjson"
local json = require "st.json"
local uint32 = require "st.matter.data_types.Uint32"
local clusters = require "st.matter.generated.zap_clusters"
local button_attr = capabilities.button.button
Expand Down Expand Up @@ -155,7 +155,7 @@ local function test_init()

local device_info_copy = utils.deep_copy(aqara_mock_device.raw_st_data)
device_info_copy.profile.id = "3-button-battery-temperature-humidity"
local device_info_json = dkjson.encode(device_info_copy)
local device_info_json = json.encode(device_info_copy)
test.socket.device_lifecycle:__queue_receive({ aqara_mock_device.id, "infoChanged", device_info_json })
test.socket.matter:__expect_send({aqara_mock_device.id, subscribe_request})
configure_buttons()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local test = require "integration_test"
local t_utils = require "integration_test.utils"
local capabilities = require "st.capabilities"
local utils = require "st.utils"
local dkjson = require "dkjson"
local json = require "st.json"
local clusters = require "st.matter.clusters"
local button_attr = capabilities.button.button

Expand Down Expand Up @@ -209,7 +209,7 @@ local function test_init()

local device_info_copy = utils.deep_copy(aqara_mock_device.raw_st_data)
device_info_copy.profile.id = "4-button"
local device_info_json = dkjson.encode(device_info_copy)
local device_info_json = json.encode(device_info_copy)
test.socket.device_lifecycle:__queue_receive({ aqara_mock_device.id, "infoChanged", device_info_json })
configure_buttons()
test.socket.matter:__expect_send({aqara_mock_device.id, subscribe_request})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local t_utils = require "integration_test.utils"
local clusters = require "st.matter.clusters"
local button_attr = capabilities.button.button
local utils = require "st.utils"
local dkjson = require "dkjson"
local json = require "st.json"
local uint32 = require "st.matter.data_types.Uint32"

--mock the actual device
Expand Down Expand Up @@ -78,7 +78,7 @@ local function test_init()

local device_info_copy = utils.deep_copy(mock_device.raw_st_data)
device_info_copy.profile.id = "buttons-battery"
local device_info_json = dkjson.encode(device_info_copy)
local device_info_json = json.encode(device_info_copy)
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "infoChanged", device_info_json })
configure_buttons()
test.socket.matter:__expect_send({mock_device.id, subscribe_request})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local test = require "integration_test"
local capabilities = require "st.capabilities"
local t_utils = require "integration_test.utils"
local utils = require "st.utils"
local dkjson = require "dkjson"
local json = require "st.json"

local clusters = require "st.matter.generated.zap_clusters"
local button_attr = capabilities.button.button
Expand Down Expand Up @@ -144,7 +144,7 @@ local function test_init()
-- simulate the profile change update taking affect and the device info changing
local device_info_copy = utils.deep_copy(mock_device.raw_st_data)
device_info_copy.profile.id = "5-buttons-battery"
local device_info_json = dkjson.encode(device_info_copy)
local device_info_json = json.encode(device_info_copy)
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "infoChanged", device_info_json })
test.socket.matter:__expect_send({mock_device.id, subscribe_request})
expect_configure_buttons()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local test = require "integration_test"
local capabilities = require "st.capabilities"
local t_utils = require "integration_test.utils"
local utils = require "st.utils"
local dkjson = require "dkjson"
local json = require "st.json"

local clusters = require "st.matter.generated.zap_clusters"

Expand Down Expand Up @@ -228,7 +228,7 @@ local function test_init()
-- simulate the profile change update taking affect and the device info changing
local device_info_copy = utils.deep_copy(mock_device.raw_st_data)
device_info_copy.profile.id = "5-buttons-battery"
local device_info_json = dkjson.encode(device_info_copy)
local device_info_json = json.encode(device_info_copy)
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "infoChanged", device_info_json })
test.socket.matter:__expect_send({mock_device.id, subscribe_request})
expect_configure_buttons()
Expand Down Expand Up @@ -442,7 +442,7 @@ test.register_coroutine_test(
-- simulate the profile change update taking affect and the device info changing
local device_info_copy = utils.deep_copy(mock_device_mcd_unsupported_switch_device_type.raw_st_data)
device_info_copy.profile.id = "5-buttons-battery"
local device_info_json = dkjson.encode(device_info_copy)
local device_info_json = json.encode(device_info_copy)
test.socket.device_lifecycle:__queue_receive({ mock_device_mcd_unsupported_switch_device_type.id, "infoChanged", device_info_json })
test.socket.matter:__expect_send({mock_device_mcd_unsupported_switch_device_type.id, subscribe_request})
end,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

local capabilities = require "st.capabilities"
local clusters = require "st.matter.clusters"
local dkjson = require "dkjson"
local json = require "st.json"
local t_utils = require "integration_test.utils"
local test = require "integration_test"
local utils = require "st.utils"
Expand Down Expand Up @@ -223,7 +223,7 @@ local function test_init()

local device_info_copy = utils.deep_copy(mock_device.raw_st_data)
device_info_copy.profile.id = "12-buttons-keyboard"
local device_info_json = dkjson.encode(device_info_copy)
local device_info_json = json.encode(device_info_copy)
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "infoChanged", device_info_json })
configure_buttons()
test.socket.matter:__expect_send({mock_device.id, subscribe_request})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ local DoorLockUserStatus = DoorLock.types.DrlkUserStatus
local DoorLockUserType = DoorLock.types.DrlkUserType
local ProgrammingEventCode = DoorLock.types.ProgramEventCode

local json = require "dkjson"
local json = require "st.json"

local mock_device = test.mock_device.build_test_zigbee_device(
{ profile = t_utils.get_profile_definition("base-lock.yml") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local zigbee_test_utils = require "integration_test.zigbee_test_utils"

local clusters = require "st.zigbee.zcl.clusters"
local capabilities = require "st.capabilities"
local json = require "dkjson"
local json = require "st.json"

local PowerConfiguration = clusters.PowerConfiguration
local Alarm = clusters.Alarms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ local zigbee_test_utils = require "integration_test.zigbee_test_utils"
local clusters = require "st.zigbee.zcl.clusters"
local capabilities = require "st.capabilities"
local t_utils = require "integration_test.utils"
local dkjson = require 'dkjson'
local json = require "st.json"
local utils = require "st.utils"
local IasEnrollResponseCode = require "st.zigbee.generated.zcl_clusters.IASZone.types.EnrollResponseCode"

Expand Down Expand Up @@ -661,7 +661,7 @@ test.register_coroutine_test(
})
local device_info_copy = utils.deep_copy(mock_device_contact_sensor.raw_st_data)
device_info_copy.profile.id = "generic-contact-sensor"
local device_info_json = dkjson.encode(device_info_copy)
local device_info_json = json.encode(device_info_copy)
test.wait_for_events()

test.socket.zigbee:__set_channel_ordering("relaxed")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

local test = require "integration_test"
local t_utils = require "integration_test.utils"
local dkjson = require 'dkjson'
local json = require "st.json"

-- This test attempts to add a zwave device to this zigbee switch driver
-- Once the monkey-patch is removed with hubcore 59 is released with:
Expand All @@ -40,7 +40,7 @@ test.register_coroutine_test("zwave_device_handled", function()
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "doConfigure" })
mock_device:expect_metadata_update({provisioning_state = "PROVISIONED"})
test.wait_for_events()
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "infoChanged", dkjson.encode(mock_device.raw_st_data) })
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "infoChanged", json.encode(mock_device.raw_st_data) })
test.wait_for_events()
end,
nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
local base64 = require "st.base64"
local cluster_base = require "st.zigbee.cluster_base"
local data_types = require "st.zigbee.data_types"
local dkjson = require 'dkjson'
local json = require "st.json"
local test = require "integration_test"
local t_utils = require "integration_test.utils"
local utils = require "st.utils"
Expand Down Expand Up @@ -53,7 +53,7 @@ test.register_coroutine_test(

local device_info_copy = utils.deep_copy(mock_device.raw_st_data)
device_info_copy.preferences.ledIntensity = 10
local device_info_json = dkjson.encode(device_info_copy)
local device_info_json = json.encode(device_info_copy)
test.wait_for_events()
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "infoChanged", device_info_json })
test.socket.zigbee:__expect_send({mock_device.id, cluster_base.write_attribute(mock_device,
Expand All @@ -76,7 +76,7 @@ test.register_coroutine_test(

local device_info_copy = utils.deep_copy(mock_device.raw_st_data)
device_info_copy.preferences.ledIntensity = 0
local device_info_json = dkjson.encode(device_info_copy)
local device_info_json = json.encode(device_info_copy)
test.wait_for_events()
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "infoChanged", device_info_json })
test.socket.zigbee:__expect_send({mock_device.id, cluster_base.write_attribute(mock_device,
Expand All @@ -99,7 +99,7 @@ test.register_coroutine_test(

local device_info_copy = utils.deep_copy(mock_device.raw_st_data)
device_info_copy.preferences.ledIntensity = 70
local device_info_json = dkjson.encode(device_info_copy)
local device_info_json = json.encode(device_info_copy)
test.wait_for_events()
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "infoChanged", device_info_json })
test.socket.zigbee:__expect_send({mock_device.id, cluster_base.write_attribute(mock_device,
Expand Down
2 changes: 1 addition & 1 deletion drivers/SmartThings/zwave-lock/src/samsung-lock/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local Notification = (require "st.zwave.CommandClass.Notification")({version=3})
local UserCode = (require "st.zwave.CommandClass.UserCode")({version=1})
local access_control_event = Notification.event.access_control

local json = require "dkjson"
local json = require "st.json"
local constants = require "st.zwave.constants"

local LockDefaults = require "st.zwave.defaults.lock"
Expand Down
2 changes: 1 addition & 1 deletion drivers/SmartThings/zwave-lock/src/schlage-lock/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
local capabilities = require "st.capabilities"
local cc = require "st.zwave.CommandClass"
local constants = require "st.zwave.constants"
local json = require "dkjson"
local json = require "st.json"

local UserCode = (require "st.zwave.CommandClass.UserCode")({version=1})
local user_id_status = UserCode.user_id_status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

local test = require "integration_test"
local capabilities = require "st.capabilities"
local json = require "dkjson"
local json = require "st.json"
local zw_test_utils = require "integration_test.zwave_test_utils"
local t_utils = require "integration_test.utils"
local UserCode = (require "st.zwave.CommandClass.UserCode")({version=1})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
local test = require "integration_test"
local capabilities = require "st.capabilities"
local zw = require "st.zwave"
local json = require "dkjson"
local json = require "st.json"
local zw_test_utils = require "integration_test.zwave_test_utils"
local t_utils = require "integration_test.utils"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
local test = require "integration_test"
local capabilities = require "st.capabilities"
local zw = require "st.zwave"
local json = require "dkjson"
local json = require "st.json"
--- @type st.zwave.constants
local constants = require "st.zwave.constants"
--- @type st.zwave.CommandClass.DoorLock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ local utils = require "st.utils"

local mock_datastore = require "integration_test.mock_env_datastore"

local json = require "dkjson"
local json = require "st.json"

local zwave_lock_endpoints = {
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ local Alarm = (require "st.zwave.CommandClass.Alarm")({ version = 1 })
local Battery = (require "st.zwave.CommandClass.Battery")({ version = 1 })
--- @type st.zwave.defaults.lockCodes
local lock_code_defaults = require "st.zwave.defaults.lockCodes"
local json = require "dkjson"
local json = require "st.json"

local METHOD = {
KEYPAD = "keypad",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ local zw_test_utils = require "integration_test.zwave_test_utils"
local utils = require "st.utils"
local Configuration = (require "st.zwave.CommandClass.Configuration")({ version=4 })
local t_utils = require "integration_test.utils"
local dkjson = require 'dkjson'
local json = require "st.json"

local INOVELLI_MANUFACTURER_ID = 0x031E
local INOVELLI_LZW31_PRODUCT_TYPE = 0x0003
Expand Down Expand Up @@ -52,7 +52,7 @@ do
function()
local device_data = utils.deep_copy(mock_inovelli_dimmer.raw_st_data)
device_data.preferences["dimmingSpeed"] = new_param_value
local device_data_json = dkjson.encode(device_data)
local device_data_json = json.encode(device_data)
test.socket.device_lifecycle:__queue_receive({ mock_inovelli_dimmer.id, "infoChanged", device_data_json })

test.socket.zwave:__expect_send(
Expand All @@ -76,7 +76,7 @@ do
function()
local device_data = utils.deep_copy(mock_inovelli_dimmer.raw_st_data)
device_data.preferences["powerOnState"] = new_param_value
local device_data_json = dkjson.encode(device_data)
local device_data_json = json.encode(device_data)
test.socket.device_lifecycle:__queue_receive({ mock_inovelli_dimmer.id, "infoChanged", device_data_json })

test.socket.zwave:__expect_send(
Expand All @@ -100,7 +100,7 @@ do
function()
local device_data = utils.deep_copy(mock_inovelli_dimmer.raw_st_data)
device_data.preferences["acPowerType"] = new_param_value
local device_data_json = dkjson.encode(device_data)
local device_data_json = json.encode(device_data)
test.socket.device_lifecycle:__queue_receive({ mock_inovelli_dimmer.id, "infoChanged", device_data_json })

test.socket.zwave:__expect_send(
Expand All @@ -124,7 +124,7 @@ do
function()
local device_data = utils.deep_copy(mock_inovelli_dimmer.raw_st_data)
device_data.preferences["autoOffTimer"] = new_param_value
local device_data_json = dkjson.encode(device_data)
local device_data_json = json.encode(device_data)
test.socket.device_lifecycle:__queue_receive({ mock_inovelli_dimmer.id, "infoChanged", device_data_json })

test.socket.zwave:__expect_send(
Expand All @@ -149,7 +149,7 @@ do
function()
local device_data = utils.deep_copy(mock_inovelli_dimmer.raw_st_data)
device_data.preferences["invertSwitch"] = new_param_value
local device_data_json = dkjson.encode(device_data)
local device_data_json = json.encode(device_data)
test.socket.device_lifecycle:__queue_receive({ mock_inovelli_dimmer.id, "infoChanged", device_data_json })

test.socket.zwave:__expect_send(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
local test = require "integration_test"
local t_utils = require "integration_test.utils"
local utils = require "st.utils"
local dkjson = require 'dkjson'
local json = require "st.json"
local zw = require "st.zwave"
local zw_test_utils = require "integration_test.zwave_test_utils"
local Configuration = (require "st.zwave.CommandClass.Configuration")({ version=4 })
Expand Down Expand Up @@ -53,7 +53,7 @@ do
function()
local device_data = utils.deep_copy(mock_qubino_din_dimmer.raw_st_data)
device_data.preferences["input1SwitchType"] = new_param_value
local device_data_json = dkjson.encode(device_data)
local device_data_json = json.encode(device_data)
test.socket.device_lifecycle:__queue_receive({ mock_qubino_din_dimmer.id, "infoChanged", device_data_json })
test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
Expand Down
Loading
Loading