diff --git a/drivers/SmartThings/matter-sensor/src/init.lua b/drivers/SmartThings/matter-sensor/src/init.lua index bc4325e4db..3bcd7e1245 100644 --- a/drivers/SmartThings/matter-sensor/src/init.lua +++ b/drivers/SmartThings/matter-sensor/src/init.lua @@ -51,7 +51,8 @@ local TEMP_BOUND_RECEIVED = "__temp_bound_received" local TEMP_MIN = "__temp_min" local TEMP_MAX = "__temp_max" -local HUE_MANUFACTURER_ID = 0x100B +-- HUE-0x100B, MultiIR-0x1477 +local NOT_SUPPORT_BATTERY_PERCENT_REMAINING_VID = {0x100B, 0x1477} local function get_field_for_endpoint(device, field, endpoint) return device:get_field(string.format("%s_%d", field, endpoint)) @@ -88,11 +89,20 @@ local function set_boolean_device_type_per_endpoint(driver, device) end end +local function battery_device_not_support_battery_percent_remaining(device) + for i = 1, #NOT_SUPPORT_BATTERY_PERCENT_REMAINING_VID do + if device.manufacturer_info.vendor_id == NOT_SUPPORT_BATTERY_PERCENT_REMAINING_VID[i] then + return false + end + end + return true +end + local function supports_battery_percentage_remaining(device) local battery_eps = device:get_endpoints(clusters.PowerSource.ID, {feature_bitmap = clusters.PowerSource.types.PowerSourceFeature.BATTERY}) -- Hue devices support the PowerSource cluster but don't support reporting battery percentage remaining - if #battery_eps > 0 and device.manufacturer_info.vendor_id ~= HUE_MANUFACTURER_ID then + if #battery_eps > 0 and battery_device_not_support_battery_percent_remaining(device) then return true end return false