From 2c0df9b6a7f0645bed8e04752269d70c35e47f6f Mon Sep 17 00:00:00 2001 From: Christian Meter Date: Mon, 16 Feb 2026 20:45:32 +0100 Subject: [PATCH 1/2] Use new level_control_lighting --- smart-light/Matter/Matter.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smart-light/Matter/Matter.swift b/smart-light/Matter/Matter.swift index 049e258..0feacf2 100644 --- a/smart-light/Matter/Matter.swift +++ b/smart-light/Matter/Matter.swift @@ -140,7 +140,7 @@ extension Matter { var lightConfig = esp_matter.endpoint.extended_color_light.config_t() lightConfig.on_off.on_off = true lightConfig.level_control.current_level = .init(64) - lightConfig.level_control.lighting.start_up_current_level = .init(64) + lightConfig.level_control_lighting.start_up_current_level = .init(64) lightConfig.color_control.color_mode = chip.app.Clusters.ColorControl.ColorMode.colorTemperature.rawValue lightConfig.color_control.enhanced_color_mode = From d3096775fb3a1d73f8906e39bee9255c677a9879 Mon Sep 17 00:00:00 2001 From: Christian Meter Date: Mon, 16 Feb 2026 20:47:55 +0100 Subject: [PATCH 2/2] Iterate over Matter IDs --- smart-light/Matter/Node.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/smart-light/Matter/Node.swift b/smart-light/Matter/Node.swift index d8a84b8..111f739 100644 --- a/smart-light/Matter/Node.swift +++ b/smart-light/Matter/Node.swift @@ -114,11 +114,14 @@ struct Endpoint: MatterEndpoint { } func `as`(_ type: T.Type) -> T? { - var count = UInt8(0) let expected = T.deviceTypeId - let ids = esp_matter.endpoint.get_device_type_ids(endpoint, &count) - for id in UnsafeMutableBufferPointer(start: ids, count: Int(count)) { - if id == expected { + let count = esp_matter.endpoint.get_device_type_count(endpoint) + for i in 0..