Skip to content

knob for blind#3

Open
pInksenberg wants to merge 2 commits intomainfrom
knob_for_blind_controll
Open

knob for blind#3
pInksenberg wants to merge 2 commits intomainfrom
knob_for_blind_controll

Conversation

@pInksenberg
Copy link
Copy Markdown
Owner

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

Duplicate profile check: Passed - no duplicate profiles detected.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 16, 2026

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 7cad4d8.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 16, 2026

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 7cad4d8

local zcl_clusters = require "st.zigbee.zcl.clusters"
local window_shade_utils = require "window_shade_utils"
local utils = require "st.utils"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing this

local log = require "log"

[capabilities.windowShadePreset.commands.presetPosition.NAME] = window_shade_preset_cmd
},
[capabilities.statelessSwitchLevelStep.ID] = {
[capabilities.statelessSwitchLevelStep.commands.stepLevel.NAME] = knob_to_window_shade_step_cmd
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please remove 'knob' word in the code.

'window_shade_step_level_cmd' would be better.
knob_target -> target_level

log.info("------------->IKEA knob step size:", step)

-- Priority: use knob_target_level if exists
local knob_target = device:get_field("knob_target_level")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

device:set_field("knob_target_level", nil) <= This logic needs to be added in the window_shade_level_cmd / window_shade_preset_cmd after 'set_shade_level'.

User can change the level through App UI while curtain is moving by knob.
If the 'knob_target_level' is not reset, knob_target will affect in next 'knob_to_window_shade_step_cmd'.

log.info("---------->IKEA curtain report level:", level, "knob_target:", knob_target)
if knob_target then
-- Allow ±1 degree tolerance for reaching target
if math.abs(level - knob_target) <= 1 then
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Let's extract the the '1' to the global constant.
local TARGET_REACH_TOLERANCE = 1 -- ±1 degree tolerance for reaching target
BWT, Is '±1' enough?

@pInksenberg pInksenberg force-pushed the knob_for_blind_controll branch from 0172af6 to 7cad4d8 Compare March 26, 2026 05:47
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