|
60 | 60 | local function handle_light_switch_with_onOff_server_clusters(device, main_endpoint)
|
61 | 61 | local cluster_id = 0
|
62 | 62 | for _, ep in ipairs(device.endpoints) do
|
63 |
| - -- main_endpoint only supports server cluster by definition of get_endpoints() |
| 63 | + -- The main endpoint only supports server cluster by definition of get_endpoints() |
64 | 64 | if main_endpoint == ep.endpoint_id then
|
65 | 65 | for _, dt in ipairs(ep.device_types) do
|
66 |
| - -- no device type that is not in the switch subset should be considered. |
| 66 | + -- No device type that is not in the switch subset should be considered. |
67 | 67 | if (common_utils.ON_OFF_SWITCH_ID <= dt.device_type_id and dt.device_type_id <= common_utils.ON_OFF_COLOR_DIMMER_SWITCH_ID) then
|
68 | 68 | cluster_id = math.max(cluster_id, dt.device_type_id)
|
69 | 69 | end
|
|
102 | 102 |
|
103 | 103 | local function match_profile(driver, device)
|
104 | 104 | local main_endpoint = find_default_endpoint(device)
|
105 |
| - -- initialize the main device card with buttons if applicable, and create child devices as needed for multi-switch devices. |
| 105 | + -- Initialize the main device card with buttons if applicable, and create child devices as needed for multi-switch devices. |
106 | 106 | local profile_found = initialize_buttons_and_switches(driver, device, main_endpoint)
|
107 | 107 | if device:get_field(common_utils.IS_PARENT_CHILD_DEVICE) then
|
108 | 108 | device:set_find_child(common_utils.find_child)
|
@@ -149,7 +149,7 @@ local function device_init(driver, device)
|
149 | 149 | device:set_find_child(common_utils.find_child)
|
150 | 150 | end
|
151 | 151 | local main_endpoint = find_default_endpoint(device)
|
152 |
| - -- ensure subscription to all endpoint attributes- including those mapped to child devices |
| 152 | + -- Ensure subscription to all endpoint attributes- including those mapped to child devices |
153 | 153 | common_utils.add_subscribed_attributes_and_events(device, main_endpoint)
|
154 | 154 | device:subscribe()
|
155 | 155 | end
|
|
0 commit comments