-
Notifications
You must be signed in to change notification settings - Fork 513
Chore/zb switch mem improvements #2461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4d11fed
Move top level requires into functions
cjswedes 5710939
Move configurations so it can be optimized
cjswedes 629f45c
Optimize configurations module to avoid devices table penalty on startup
cjswedes bd1b06f
Use lazy handler for some lifecycle handlers at the top level driver
cjswedes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
243 changes: 0 additions & 243 deletions
243
drivers/SmartThings/zigbee-switch/src/configurations.lua
This file was deleted.
Oops, something went wrong.
126 changes: 126 additions & 0 deletions
126
drivers/SmartThings/zigbee-switch/src/configurations/devices.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
-- Copyright 2025 SmartThings | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
local clusters = require "st.zigbee.zcl.clusters" | ||
local ColorControl = clusters.ColorControl | ||
local IASZone = clusters.IASZone | ||
local ElectricalMeasurement = clusters.ElectricalMeasurement | ||
local SimpleMetering = clusters.SimpleMetering | ||
local Alarms = clusters.Alarms | ||
local constants = require "st.zigbee.constants" | ||
|
||
local devices = { | ||
IKEA_RGB_BULB = { | ||
FINGERPRINTS = { | ||
{ mfr = "IKEA of Sweden", model = "TRADFRI bulb E27 CWS opal 600lm" }, | ||
{ mfr = "IKEA of Sweden", model = "TRADFRI bulb E26 CWS opal 600lm" } | ||
}, | ||
CONFIGURATION = { | ||
{ | ||
cluster = ColorControl.ID, | ||
attribute = ColorControl.attributes.CurrentX.ID, | ||
minimum_interval = 1, | ||
maximum_interval = 3600, | ||
data_type = ColorControl.attributes.CurrentX.base_type, | ||
reportable_change = 16 | ||
}, | ||
{ | ||
cluster = ColorControl.ID, | ||
attribute = ColorControl.attributes.CurrentY.ID, | ||
minimum_interval = 1, | ||
maximum_interval = 3600, | ||
data_type = ColorControl.attributes.CurrentY.base_type, | ||
reportable_change = 16 | ||
} | ||
} | ||
}, | ||
SENGLED_BULB_WITH_MOTION_SENSOR = { | ||
FINGERPRINTS = { | ||
{ mfr = "sengled", model = "E13-N11" } | ||
}, | ||
CONFIGURATION = { | ||
{ | ||
cluster = IASZone.ID, | ||
attribute = IASZone.attributes.ZoneStatus.ID, | ||
minimum_interval = 30, | ||
maximum_interval = 300, | ||
data_type = IASZone.attributes.ZoneStatus.base_type | ||
} | ||
}, | ||
IAS_ZONE_CONFIG_METHOD = constants.IAS_ZONE_CONFIGURE_TYPE.AUTO_ENROLL_RESPONSE | ||
}, | ||
FRIENT_SWITCHES = { | ||
FINGERPRINTS = { | ||
{ mfr = "frient A/S", model = "SPLZB-131" }, | ||
{ mfr = "frient A/S", model = "SPLZB-132" }, | ||
{ mfr = "frient A/S", model = "SPLZB-134" }, | ||
{ mfr = "frient A/S", model = "SPLZB-137" }, | ||
{ mfr = "frient A/S", model = "SPLZB-141" }, | ||
{ mfr = "frient A/S", model = "SPLZB-142" }, | ||
{ mfr = "frient A/S", model = "SPLZB-144" }, | ||
{ mfr = "frient A/S", model = "SPLZB-147" }, | ||
{ mfr = "frient A/S", model = "SMRZB-143" }, | ||
{ mfr = "frient A/S", model = "SMRZB-153" }, | ||
{ mfr = "frient A/S", model = "SMRZB-332" }, | ||
{ mfr = "frient A/S", model = "SMRZB-342" } | ||
}, | ||
CONFIGURATION = { | ||
{ | ||
cluster = ElectricalMeasurement.ID, | ||
attribute = ElectricalMeasurement.attributes.RMSVoltage.ID, | ||
minimum_interval = 5, | ||
maximum_interval = 3600, | ||
data_type = ElectricalMeasurement.attributes.RMSVoltage.base_type, | ||
reportable_change = 1 | ||
},{ | ||
cluster = ElectricalMeasurement.ID, | ||
attribute = ElectricalMeasurement.attributes.RMSCurrent.ID, | ||
minimum_interval = 5, | ||
maximum_interval = 3600, | ||
data_type = ElectricalMeasurement.attributes.RMSCurrent.base_type, | ||
reportable_change = 1 | ||
},{ | ||
cluster = ElectricalMeasurement.ID, | ||
attribute = ElectricalMeasurement.attributes.ActivePower.ID, | ||
minimum_interval = 5, | ||
maximum_interval = 3600, | ||
data_type = ElectricalMeasurement.attributes.ActivePower.base_type, | ||
reportable_change = 1 | ||
},{ | ||
cluster = SimpleMetering.ID, | ||
attribute = SimpleMetering.attributes.InstantaneousDemand.ID, | ||
minimum_interval = 5, | ||
maximum_interval = 3600, | ||
data_type = SimpleMetering.attributes.InstantaneousDemand.base_type, | ||
reportable_change = 1 | ||
},{ | ||
cluster = SimpleMetering.ID, | ||
attribute = SimpleMetering.attributes.CurrentSummationDelivered.ID, | ||
minimum_interval = 5, | ||
maximum_interval = 3600, | ||
data_type = SimpleMetering.attributes.CurrentSummationDelivered.base_type, | ||
reportable_change = 1 | ||
},{ | ||
cluster = Alarms.ID, | ||
attribute = Alarms.attributes.AlarmCount.ID, | ||
minimum_interval = 1, | ||
maximum_interval = 3600, | ||
data_type = Alarms.attributes.AlarmCount.base_type, | ||
reportable_change = 1, | ||
}, | ||
} | ||
}, | ||
} | ||
|
||
return devices |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.