Skip to content

[Aqara] add Aqara Bath Heater T1#2942

Open
seojune79 wants to merge 4 commits into
SmartThingsCommunity:mainfrom
seojune79:Aqara-Bath-Heater
Open

[Aqara] add Aqara Bath Heater T1#2942
seojune79 wants to merge 4 commits into
SmartThingsCommunity:mainfrom
seojune79:Aqara-Bath-Heater

Conversation

@seojune79
Copy link
Copy Markdown
Contributor

@seojune79 seojune79 commented May 4, 2026

Check all that apply

Type of Change

  • WWST Certification Request
    • If this is your first time contributing code:
      • I have reviewed the README.md file
      • I have reviewed the CODE_OF_CONDUCT.md file
      • I have signed the CLA
    • I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • Bug fix
  • New feature
  • Refactor

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have verified my changes by testing with a device or have communicated a plan for testing
  • I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

Summary of Completed Tests

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Duplicate profile check: Passed - no duplicate profiles detected.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Test Results

   73 files    511 suites   0s ⏱️
2 909 tests 2 909 ✅ 0 💤 0 ❌
4 779 runs  4 779 ✅ 0 💤 0 ❌

Results for commit 86aba8c.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

File Coverage
All files 94%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/Aqara/aqara-bath-heater/src/init.lua 94%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 86aba8c

HIGH = "high",
}
local MODE_TO_FAN = { [SPEED.LOW] = FAN_LOW, [SPEED.MEDIUM] = FAN_MID, [SPEED.HIGH] = FAN_HIGH }
local FAN_TO_MODE = { [0] = SPEED.LOW, [1] = SPEED.MEDIUM, [2] = SPEED.HIGH }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
local FAN_TO_MODE = { [0] = SPEED.LOW, [1] = SPEED.MEDIUM, [2] = SPEED.HIGH }
local FAN_TO_MODE = { [FAN_LOW] = SPEED.LOW, [FAN_MID] = SPEED.MEDIUM, [FAN_HIGH] = SPEED.HIGH }

nit: Keep them interlocked

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made the requested changes.


if params.setpoint ~= nil then
local sp_raw = math.floor(clamp(params.setpoint, 16, 45) * 100) & 0xFFFF
hi32 = (sp_raw << 16) | (hi32 & 0xFFFF)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hi32 = (sp_raw << 16) | (hi32 & 0xFFFF)
hi32 = (sp_raw << 16) | 0xFFFF

Since hi32 is unmodified from being set to 0xFFFFFFFF and (hi32 & 0xFFFF) will always evaluate to 0xFFFF

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unnecessary computations have been removed.

…ition since hi32 remains 0xFFFFFFFF, making (hi32 & 0xFFFF) always 0xFFFF.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants