add MultiIR contact sensor MIR_MC100#2867
add MultiIR contact sensor MIR_MC100#2867thinkaName wants to merge 1 commit intoSmartThingsCommunity:mainfrom
Conversation
|
Duplicate profile check: Passed - no duplicate profiles detected. |
|
Invitation URL: |
Test Results 72 files 500 suites 0s ⏱️ Results for commit a983a46. ♻️ This comment has been updated with latest results. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against a983a46 |
c237c6b to
a983a46
Compare
cjswedes
left a comment
There was a problem hiding this comment.
I am confused as to whether this device uses IAS Zone to report the contact sensor state or not. The mock device does not contain the IAS Zone attribute, and the init handler removes the bind/reporting configuration setup for the cluster, and the overridden doConfigure handler means the IAS zone cluster will not be setup to enroll in zone status notification.s
| local function do_configure(driver, device) | ||
| device:configure() | ||
| end |
There was a problem hiding this comment.
Use the default handler. It calls device:configure() which takes care of ias zone configuration as well as the other attributes, and injects a refresh command.
| local function device_init(driver, device) | ||
| device:remove_configured_attribute(IASZone.ID, IASZone.attributes.ZoneStatus.ID) | ||
| device:remove_monitored_attribute(IASZone.ID, IASZone.attributes.ZoneStatus.ID) | ||
| local configuration = configurationMap.get_device_configuration(device) | ||
| if configuration ~= nil then | ||
| for _, attribute in ipairs(configuration) do | ||
| device:add_configured_attribute(attribute) | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
I dont think you want to do this. Removing the ZoneStatus attribute from the configured attributes means device:configure() will not actually send the bind and ConfigureReporting messages to setup the attribute reporting; this mean the hub will not be notified of state changes via this attribute in the contact sensor and the device will be more likely to fall offline.
Also, the configuration map does not have an entry for the device so configuration will always be nil, and not have attributes added to the configuration. Other subdrivers use this pattern because they use different clusters for contact sensing.
Do you expect the device to report the ZoneStatus attribute?
| id = 0x01, | ||
| manufacturer = "MultIR", | ||
| model = "MIR-MC100", | ||
| server_clusters = { 0x0001,0x0003, 0x0005, 0x0006 } |
There was a problem hiding this comment.
This does not include ias zone cluster, but the driver is written like the device would include it. Make sure your mock device is setup with the same endpoints/clusters as the real device.
Check all that apply
Type of Change
Checklist
Description of Change
Summary of Completed Tests