Skip to content

Commit e4762f5

Browse files
authored
remove Hue flagged battery gating (#2036)
1 parent 646fdb6 commit e4762f5

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

drivers/SmartThings/matter-sensor/src/init.lua

+1-4
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ local TEMP_BOUND_RECEIVED = "__temp_bound_received"
5252
local TEMP_MIN = "__temp_min"
5353
local TEMP_MAX = "__temp_max"
5454

55-
local HUE_MANUFACTURER_ID = 0x100B
56-
5755
local battery_support = {
5856
NO_BATTERY = "NO_BATTERY",
5957
BATTERY_LEVEL = "BATTERY_LEVEL",
@@ -172,8 +170,7 @@ end
172170

173171
local function do_configure(driver, device)
174172
local battery_feature_eps = device:get_endpoints(clusters.PowerSource.ID, {feature_bitmap = clusters.PowerSource.types.PowerSourceFeature.BATTERY})
175-
-- Hue devices support the PowerSource cluster but don't support reporting battery percentage remaining
176-
if #battery_feature_eps > 0 and device.manufacturer_info.vendor_id ~= HUE_MANUFACTURER_ID then
173+
if #battery_feature_eps > 0 then
177174
local attribute_list_read = im.InteractionRequest(im.InteractionRequest.RequestType.READ, {})
178175
attribute_list_read:merge(clusters.PowerSource.attributes.AttributeList:read())
179176
device:send(attribute_list_read)

drivers/SmartThings/matter-switch/src/init.lua

-2
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ local TEMP_BOUND_RECEIVED = "__temp_bound_received"
309309
local TEMP_MIN = "__temp_min"
310310
local TEMP_MAX = "__temp_max"
311311

312-
local HUE_MANUFACTURER_ID = 0x100B
313312
local AQARA_MANUFACTURER_ID = 0x115F
314313
local AQARA_CLIMATE_SENSOR_W100_ID = 0x2004
315314

@@ -609,7 +608,6 @@ local function build_button_profile(device, main_endpoint, num_button_eps)
609608
else
610609
profile_name = num_button_eps .. "-button"
611610
battery_supported = #device:get_endpoints(clusters.PowerSource.ID, {feature_bitmap = clusters.PowerSource.types.PowerSourceFeature.BATTERY}) > 0
612-
if device.manufacturer_info.vendor_id == HUE_MANUFACTURER_ID then battery_supported = false end -- no battery support in Hue case
613611
if battery_supported then
614612
local attribute_list_read = im.InteractionRequest(im.InteractionRequest.RequestType.READ, {})
615613
attribute_list_read:merge(clusters.PowerSource.attributes.AttributeList:read())

0 commit comments

Comments
 (0)