Skip to content

Commit 620966c

Browse files
committed
update util function names
1 parent 9368f67 commit 620966c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

drivers/SmartThings/matter-switch/src/generic_handlers/attribute_handlers.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ function AttributeHandlers.power_source_attribute_list_handler(driver, device, i
361361
profile_name = string.format("%d-", #button_eps) .. profile_name
362362
end
363363

364-
if switch_utils.check_vendor_overrides(device, "is_climate_sensor_w100") then
364+
if switch_utils.get_product_override_field(device, "is_climate_sensor_w100") then
365365
profile_name = profile_name .. "-temperature-humidity"
366366
end
367367
device:try_update_metadata({ profile = profile_name })

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function SwitchDeviceConfiguration.assign_child_profile(device, child_ep)
5252

5353
-- workaround: Aqara Light Switch H2: add Electrical Sensor profile only to the first EDGE_CHILD
5454
if child_ep == 1 then
55-
profile = switch_utils.check_vendor_overrides(device, "target_profile") or profile
55+
profile = switch_utils.get_product_override_field(device, "target_profile") or profile
5656
end
5757

5858
-- default to "switch-binary" if no profile is found

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function utils.mired_to_kelvin(value, minOrMax)
6363
end
6464
end
6565

66-
function utils.check_vendor_overrides(device, override_key)
66+
function utils.get_product_override_field(device, override_key)
6767
if fields.vendor_overrides[device.manufacturer_info.vendor_id]
6868
and fields.vendor_overrides[device.manufacturer_info.vendor_id][device.manufacturer_info.product_id]
6969
then
@@ -86,18 +86,18 @@ end
8686
--- whether the device type for an endpoint is currently supported by a profile for
8787
--- combination button/switch devices.
8888
function utils.device_type_supports_button_switch_combination(device, endpoint_id)
89-
if utils.check_vendor_overrides(device, "ignore_combo_switch_button") then
89+
if utils.get_product_override_field(device, "ignore_combo_switch_button") then
9090
return false
9191
end
92-
local dimmable_eps = utils.get_endpoints_by_dt(device, fields.DIMMABLE_LIGHT_DEVICE_TYPE_ID)
92+
local dimmable_eps = utils.get_endpoints_by_device_type(device, fields.DIMMABLE_LIGHT_DEVICE_TYPE_ID)
9393
return utils.tbl_contains(dimmable_eps, endpoint_id)
9494
end
9595

9696
--- find_default_endpoint is a helper function to handle situations where
9797
--- device does not have endpoint ids in sequential order from 1
9898
function utils.find_default_endpoint(device)
9999
-- Buttons should not be set on the main component for the Aqara Climate Sensor W100,
100-
if utils.check_vendor_overrides(device, "is_climate_sensor_w100") then
100+
if utils.get_product_override_field(device, "is_climate_sensor_w100") then
101101
return device.MATTER_DEFAULT_ENDPOINT
102102
end
103103

@@ -169,7 +169,7 @@ function utils.matter_handler(driver, device, response_block)
169169
end
170170

171171
-- get a list of endpoints for a specified device type.
172-
function utils.get_endpoints_by_dt(device, device_type_id)
172+
function utils.get_endpoints_by_device_type(device, device_type_id)
173173
local dt_eps = {}
174174
for _, ep in ipairs(device.endpoints) do
175175
for _, dt in ipairs(ep.device_types) do
@@ -193,7 +193,7 @@ function utils.create_multi_press_values_list(size, supportsHeld)
193193
end
194194

195195
function utils.detect_bridge(device)
196-
return #utils.get_endpoints_by_dt(device, fields.AGGREGATOR_DEVICE_TYPE_ID) > 0
196+
return #utils.get_endpoints_by_device_type(device, fields.AGGREGATOR_DEVICE_TYPE_ID) > 0
197197
end
198198

199199
function utils.detect_matter_thing(device)

0 commit comments

Comments
 (0)