Skip to content
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

Add modern configuration options for SIN-4-RS-20 and SIN-4-RS-20_PRO #3901

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

ikruglov
Copy link
Contributor

@ikruglov ikruglov commented Feb 23, 2025

Proposed change

This PR adds the following configuration options for NodOn roller shutter SIN-4-RS-20 and PRO version

  • calibration_vertical_run_time_up - Set vertical run time up of the roller shutter
  • calibration_vertical_run_time_down - Set vertical run time down of the roller shutter
  • calibration_rotation_run_time_up - Set rotation run time up of the roller shutter
  • calibration_rotation_run_time_down - Set rotation run time down of the roller shutter

All these settings allow fine-tune calibration if necessary.

Additional information

This is a port of https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/devices/nodon.ts#L16

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works

@ikruglov ikruglov marked this pull request as draft February 23, 2025 10:38
Copy link

codecov bot commented Feb 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.99%. Comparing base (bd9ecbb) to head (42ce393).
Report is 10 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3901      +/-   ##
==========================================
+ Coverage   90.96%   90.99%   +0.02%     
==========================================
  Files         327      328       +1     
  Lines       10606    10637      +31     
==========================================
+ Hits         9648     9679      +31     
  Misses        958      958              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ikruglov ikruglov marked this pull request as ready for review February 23, 2025 10:44
Copy link
Collaborator

@TheJulianJES TheJulianJES left a comment

Choose a reason for hiding this comment

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

Seems good otherwise.

class NodOnWindowCovering(WindowCovering, CustomCluster):
"""NodOn custom WindowCovering cluster."""

class AttributeDefs(BaseAttributeDefs):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason to not inherit from WindowCovering.AttributeDefs here?
If that's done, we could remove all the copied attributes from zigpy below.

Copy link
Collaborator

@TheJulianJES TheJulianJES Feb 26, 2025

Choose a reason for hiding this comment

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

Ah, the other attributes have the same attribute id. Hmm..
Does it not work if both are included? There should be a difference because of the manufacturer id. But it might not work with zigpy cache and some other zigpy parts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the attributes have same IDs. Happy to inherit and override if there is an easy way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it doesn't work of if I just inherit. It was my first approach and it didn't work.

step=10,
unit=UnitOfTime.MILLISECONDS,
device_class=NumberDeviceClass.DURATION,
initially_disabled=True,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should removed initially_disabled=True everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi. I don't have a strong opinion but these parameters are to fine-tune or override settings after internal calibration procedure. So, they are not much useful by default. Hence, I think it makes sense to keep them disabled by default.

@TheJulianJES TheJulianJES added smash This PR is close to be merged soon needs review This PR should be reviewed soon, as it generally looks good. labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review This PR should be reviewed soon, as it generally looks good. smash This PR is close to be merged soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants