Skip to content

Commit 0723d13

Browse files
committed
Implementing changes from code review: edit of the device profile name and capability order, edit of the match_profile's condition
1 parent e27f1c6 commit 0723d13

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

drivers/SmartThings/matter-switch/fingerprints.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ matterManufacturer:
141141
deviceLabel: "Motion Detector II [+M]"
142142
vendorId: 0x1209
143143
productId: 0x3013
144-
deviceProfileName: light-level-motion-illuminance-battery-temp
144+
deviceProfileName: light-level-battery-illuminance-motion-temperature
145145
#Chengdu
146146
- id: "5218/8197"
147147
deviceLabel: Magic Cube DS001

drivers/SmartThings/matter-switch/profiles/light-level-motion-illuminance-battery-temp.yml renamed to drivers/SmartThings/matter-switch/profiles/light-level-battery-illuminance-motion-temperature.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: light-level-motion-illuminance-battery-temp
1+
name: light-level-battery-illuminance-motion-temperature
22
components:
33
- id: main
44
capabilities:
@@ -8,12 +8,6 @@ components:
88
version: 1
99
- id: illuminanceMeasurement
1010
version: 1
11-
- id: battery
12-
version: 1
13-
- id: firmwareUpdate
14-
version: 1
15-
- id: refresh
16-
version: 1
1711
- id: switch
1812
version: 1
1913
- id: switchLevel
@@ -22,6 +16,12 @@ components:
2216
values:
2317
- key: "level.value"
2418
range: [1, 100]
19+
- id: battery
20+
version: 1
21+
- id: firmwareUpdate
22+
version: 1
23+
- id: refresh
24+
version: 1
2525
categories:
2626
- name: MotionSensor
2727
preferences:

drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,7 @@ function DeviceConfiguration.match_profile(driver, device)
192192
elseif generic_profile("light-color-level") and #device:get_endpoints(clusters.FanControl.ID) > 0 then
193193
updated_profile = "light-color-level-fan"
194194
elseif generic_profile("light-level") and #device:get_endpoints(clusters.OccupancySensing.ID) > 0 then
195-
updated_profile = "light-level-motion"
196-
if switch_utils.check_switch_category_vendor_overrides(device) then
197-
updated_profile = fields.vendor_overrides[device.manufacturer_info.vendor_id][device.manufacturer_info.product_id].target_profile
198-
end
195+
updated_profile = switch_utils.get_product_override_field(device, "target_profile") or "light-level-motion"
199196
elseif generic_profile("light-level-colorTemperature") or generic_profile("light-color-level") then
200197
-- ignore attempts to dynamically profile light-level-colorTemperature and light-color-level devices for now, since
201198
-- these may lose fingerprinted Kelvin ranges when dynamically profiled.

drivers/SmartThings/matter-switch/src/switch_utils/fields.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ SwitchFields.vendor_overrides = {
119119
[0x2004] = { is_climate_sensor_w100 = true }, -- Climate Sensor W100, requires unique profile
120120
},
121121
[0x1209] = { -- Bosch
122-
[0x3013] = {target_profile = "light-level-motion-illuminance-battery-temp"}
122+
[0x3013] = {target_profile = "light-level-battery-illuminance-motion-temperature"}
123123
}
124124
}
125125

0 commit comments

Comments
 (0)