add MultiIR Siren MIR-SR100#2873
add MultiIR Siren MIR-SR100#2873thinkaName wants to merge 1 commit intoSmartThingsCommunity:mainfrom
Conversation
|
Duplicate profile check: Passed - no duplicate profiles detected. |
|
Invitation URL: |
Test Results 72 files 507 suites 0s ⏱️ Results for commit 45687a6. ♻️ This comment has been updated with latest results. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 45687a6 |
310380b to
45687a6
Compare
cjswedes
left a comment
There was a problem hiding this comment.
Nice work, just a couple style things, and one issue with handling nil preferences (which shouldnt happen, but the logic could pass a boolean rather than the default if it was nil).
| local sirenVolume_msg = tonumber(device.preferences.sirenVolume) | ||
| local warning_duration = tonumber(device.preferences.warningDuration) | ||
|
|
||
| send_siren_command(device, WarningMode , sirenVolume_msg == nil or IaswdLevel.VERY_HIGH_LEVEL ,warning_duration == nil or DEFAULT_MAX_WARNING_DURATION, Strobe, strobe_level) |
There was a problem hiding this comment.
| local sirenVolume_msg = tonumber(device.preferences.sirenVolume) | |
| local warning_duration = tonumber(device.preferences.warningDuration) | |
| send_siren_command(device, WarningMode , sirenVolume_msg == nil or IaswdLevel.VERY_HIGH_LEVEL ,warning_duration == nil or DEFAULT_MAX_WARNING_DURATION, Strobe, strobe_level) | |
| local sirenVolume_msg = tonumber(device.preferences.sirenVolume) or IaswdLevel.VERY_HIGH_LEVEL | |
| local warning_duration = tonumber(device.preferences.warningDuration) or DEFAULT_MAX_WARNING_DURATION | |
| warning_duration = math.min(DEFAULT_MAX_WARNING_DURATION, warning_duration) | |
| send_siren_command(device, WarningMode , sirenVolume_msg , warning_duration, Strobe, strobe_level) |
| IASZone.attributes.ZoneStatus:read(mock_device) | ||
| } | ||
| }, | ||
| { |
There was a problem hiding this comment.
nit: indentation incorrect
There was a problem hiding this comment.
Please add a test that validates a preference that is not the default for the warning duration and siren volume
| - id: main | ||
| capabilities: | ||
| - id: switch | ||
| version: 1 |
Check all that apply
Type of Change
Checklist
Description of Change
Summary of Completed Tests