Skip to content

Commit

Permalink
Merge pull request #1576 from SmartThingsCommunity/main
Browse files Browse the repository at this point in the history
Releasing Main to Beta
  • Loading branch information
lelandblue authored Aug 12, 2024
2 parents d7a1017 + 9b18d70 commit 1faeb5d
Show file tree
Hide file tree
Showing 25 changed files with 499 additions and 84 deletions.
4 changes: 4 additions & 0 deletions drivers/SmartThings/hub/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: 'hub'
packageKey: 'hub'
description: "SmartThings driver for Hub devices"
vendorSupportInformation: "https://support.smartthings.com"
17 changes: 17 additions & 0 deletions drivers/SmartThings/hub/fingerprints.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
hub:
- id: "tv-hub"
deviceLabel: SmartThings Hub
hardwareType: SAMSUNG_VD_TV_HUB
deviceProfileName: tv-hub
- id: "soundbar-hub"
deviceLabel: SmartThings Hub
hardwareType: SAMSUNG_SOUNDBAR_TIZEN_OPEN_HUB
deviceProfileName: soundbar-hub
- id: "refrigerator-hub"
deviceLabel: SmartThings Hub
hardwareType: SAMSUNG_DA_REFRIGERATOR_HUB
deviceProfileName: refrigerator-hub
hubThing:
- id: "hub-thing"
deviceLabel: SmartThings Hub
deviceProfileName: hub-thing
13 changes: 13 additions & 0 deletions drivers/SmartThings/hub/profiles/hub-thing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: hub-thing
components:
- id: main
label: main
capabilities:
- id: bridge
version: 1
ephemeral: false
categories:
- name: Hub
categoryType: manufacturer
metadata:
ocfDeviceType: x.com.st.d.hub
17 changes: 17 additions & 0 deletions drivers/SmartThings/hub/profiles/refrigerator-hub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: refrigerator-hub
components:
- id: main
label: main
capabilities:
- id: bridge
version: 1
ephemeral: false
categories:
- name: Hub
categoryType: manufacturer
config:
icons:
- badge:
- iconUrl: badge://refrigerator
metadata:
ocfDeviceType: x.com.st.d.hub
17 changes: 17 additions & 0 deletions drivers/SmartThings/hub/profiles/soundbar-hub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: soundbar-hub
components:
- id: main
label: main
capabilities:
- id: bridge
version: 1
ephemeral: false
categories:
- name: Hub
categoryType: manufacturer
config:
icons:
- badge:
- iconUrl: badge://soundbar
metadata:
ocfDeviceType: x.com.st.d.hub
17 changes: 17 additions & 0 deletions drivers/SmartThings/hub/profiles/tv-hub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: tv-hub
components:
- id: main
label: main
capabilities:
- id: bridge
version: 1
ephemeral: false
categories:
- name: Hub
categoryType: manufacturer
config:
icons:
- badge:
- iconUrl: badge://tv
metadata:
ocfDeviceType: x.com.st.d.hub
Empty file.
38 changes: 38 additions & 0 deletions drivers/SmartThings/matter-button/profiles/5-button-battery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 5-button-battery
components:
- id: main
capabilities:
- id: button
version: 1
- id: battery
version: 1
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: RemoteController
- id: button2
capabilities:
- id: button
version: 1
categories:
- name: RemoteController
- id: button3
capabilities:
- id: button
version: 1
categories:
- name: RemoteController
- id: button4
capabilities:
- id: button
version: 1
categories:
- name: RemoteController
- id: button5
capabilities:
- id: button
version: 1
categories:
- name: RemoteController
36 changes: 36 additions & 0 deletions drivers/SmartThings/matter-button/profiles/5-button.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 5-button
components:
- id: main
capabilities:
- id: button
version: 1
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: RemoteController
- id: button2
capabilities:
- id: button
version: 1
categories:
- name: RemoteController
- id: button3
capabilities:
- id: button
version: 1
categories:
- name: RemoteController
- id: button4
capabilities:
- id: button
version: 1
categories:
- name: RemoteController
- id: button5
capabilities:
- id: button
version: 1
categories:
- name: RemoteController
2 changes: 1 addition & 1 deletion drivers/SmartThings/matter-button/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local START_BUTTON_PRESS = "__start_button_press"
local TIMEOUT_THRESHOLD = 10 --arbitrary timeout
local HELD_THRESHOLD = 1
-- this is the number of buttons for which we have a static profile already made
local STATIC_PROFILE_SUPPORTED = {2, 4, 6, 8}
local STATIC_PROFILE_SUPPORTED = {2, 4, 5, 6, 8}

local COMPONENT_TO_ENDPOINT_MAP = "__component_to_endpoint_map"
local DEFERRED_CONFIGURE = "__DEFERRED_CONFIGURE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,9 @@ local mock_device = test.mock_device.build_test_matter_device(
clusters = {
{
cluster_id = clusters.Switch.ID,
feature_map = clusters.Switch.types.SwitchFeature.MOMENTARY_SWITCH | clusters.Switch.types.SwitchFeature.MOMENTARY_SWITCH_LONG_PRESS,
cluster_type = "SERVER"
},
},
},
{
endpoint_id = 5,
clusters = {
{
cluster_id = clusters.Switch.ID,
feature_map = clusters.Switch.types.SwitchFeature.MOMENTARY_SWITCH | clusters.Switch.types.SwitchFeature.MOMENTARY_SWITCH_MULTI_PRESS,
cluster_type = "SERVER"
},
},
},
{
endpoint_id = 6,
clusters = {
{
cluster_id = clusters.Switch.ID,
feature_map = clusters.Switch.types.SwitchFeature.MOMENTARY_SWITCH | clusters.Switch.types.SwitchFeature.MOMENTARY_SWITCH_MULTI_PRESS,
feature_map = clusters.Switch.types.SwitchFeature.MOMENTARY_SWITCH
| clusters.Switch.types.SwitchFeature.MOMENTARY_SWITCH_LONG_PRESS
| clusters.Switch.types.SwitchFeature.MOMENTARY_SWITCH_MULTI_PRESS,
cluster_type = "SERVER"
},
},
Expand Down Expand Up @@ -124,29 +106,9 @@ local function test_init()
parent_device_id = mock_device.id,
parent_assigned_child_key = "04"
})
test.socket.capability:__expect_send(mock_children[4]:generate_test_message("main", capabilities.button.supportedButtonValues({"pushed", "held"}, {visibility = {displayed = false}})))
test.socket.matter:__expect_send({mock_device.id, clusters.Switch.attributes.MultiPressMax:read(mock_device, 4)})
test.socket.capability:__expect_send(mock_children[4]:generate_test_message("main", button_attr.pushed({state_change = false})))

mock_device:expect_device_create({
type = "EDGE_CHILD",
label = "Matter Button 4",
profile = "button",
parent_device_id = mock_device.id,
parent_assigned_child_key = "05"
})
test.socket.matter:__expect_send({mock_device.id, clusters.Switch.attributes.MultiPressMax:read(mock_device, 5)})
test.socket.capability:__expect_send(mock_children[5]:generate_test_message("main", button_attr.pushed({state_change = false})))

mock_device:expect_device_create({
type = "EDGE_CHILD",
label = "Matter Button 5",
profile = "button",
parent_device_id = mock_device.id,
parent_assigned_child_key = "06"
})
test.socket.matter:__expect_send({mock_device.id, clusters.Switch.attributes.MultiPressMax:read(mock_device, 6)})
test.socket.capability:__expect_send(mock_children[6]:generate_test_message("main", button_attr.pushed({state_change = false})))

end

test.set_test_init_function(test_init)
Expand Down Expand Up @@ -242,27 +204,6 @@ test.register_message_test(
}
)

test.register_message_test(
"Receiving a max press attribute of 2 should emit correct event", {
{
channel = "matter",
direction = "receive",
message = {
mock_device.id,
clusters.Switch.attributes.MultiPressMax:build_test_report_data(
mock_device, 6, 2
)
},
},
{
channel = "capability",
direction = "send",
message = mock_children[6]:generate_test_message("main",
capabilities.button.supportedButtonValues({"pushed", "double"}, {visibility = {displayed = false}}))
},
}
)

test.register_message_test(
"Receiving a max press attribute of 3 should emit correct event", {
{
Expand All @@ -271,15 +212,15 @@ test.register_message_test(
message = {
mock_device.id,
clusters.Switch.attributes.MultiPressMax:build_test_report_data(
mock_device, 5, 3
mock_device, 4, 3
)
},
},
{
channel = "capability",
direction = "send",
message = mock_children[5]:generate_test_message("main",
capabilities.button.supportedButtonValues({"pushed", "double", "pushed_3x"}, {visibility = {displayed = false}}))
message = mock_children[4]:generate_test_message("main",
capabilities.button.supportedButtonValues({"pushed", "double", "held", "pushed_3x"}, {visibility = {displayed = false}}))
},
}
)
Expand Down Expand Up @@ -313,7 +254,7 @@ test.register_message_test(
message = {
mock_device.id,
clusters.Switch.events.InitialPress:build_test_event_report(
mock_device, 5, {new_position = 1}
mock_device, 4, {new_position = 1}
)
}
},
Expand All @@ -323,14 +264,14 @@ test.register_message_test(
message = {
mock_device.id,
clusters.Switch.events.MultiPressComplete:build_test_event_report(
mock_device, 5, {new_position = 1, total_number_of_presses_counted = 2, previous_position = 0}
mock_device, 4, {new_position = 1, total_number_of_presses_counted = 2, previous_position = 0}
)
}
},
{
channel = "capability",
direction = "send",
message = mock_children[5]:generate_test_message("main", button_attr.double({state_change = true}))
message = mock_children[4]:generate_test_message("main", button_attr.double({state_change = true}))
},

}
Expand All @@ -344,7 +285,7 @@ test.register_message_test(
message = {
mock_device.id,
clusters.Switch.events.InitialPress:build_test_event_report(
mock_device, 6, {new_position = 1}
mock_device, 4, {new_position = 1}
)
}
},
Expand All @@ -354,14 +295,14 @@ test.register_message_test(
message = {
mock_device.id,
clusters.Switch.events.MultiPressComplete:build_test_event_report(
mock_device, 6, {new_position = 1, total_number_of_presses_counted = 4, previous_position = 0}
mock_device, 4, {new_position = 1, total_number_of_presses_counted = 4, previous_position = 0}
)
}
},
{
channel = "capability",
direction = "send",
message = mock_children[6]:generate_test_message("main", button_attr.pushed_4x({state_change = true}))
message = mock_children[4]:generate_test_message("main", button_attr.pushed_4x({state_change = true}))
},

}
Expand Down
5 changes: 5 additions & 0 deletions drivers/SmartThings/matter-switch/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ matterManufacturer:
vendorId: 0x1168
productId: 0x03F3
deviceProfileName: light-color-level-1800K-6500K
- id: "Linkind/Smart/Light/Bulb/A19/CCT"
deviceLabel: Smart Light Bulb A19 CCT
vendorId: 0x1168
productId: 0x03f9
deviceProfileName: light-level-colorTemperature-2700K-6500K
- id: "4456/1013"
deviceLabel: Matter Smart Light Bulb A21 RGBTW 1600lm
vendorId: 0x1168
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: light-level-colorTemperature-2700K-6500K
components:
- id: main
capabilities:
- id: switch
version: 1
- id: switchLevel
version: 1
config:
values:
- key: "level.value"
range: [1, 100]
- id: colorTemperature
version: 1
config:
values:
- key: "colorTemperature.value"
range: [ 2700, 6500 ]
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: Light
Loading

0 comments on commit 1faeb5d

Please sign in to comment.