Skip to content

Add custom min/max to window covering tilt angle characteristics - #209

Open
yfre wants to merge 3 commits into
masterfrom
feature/162-custom-min-max
Open

yfre wants to merge 3 commits into
masterfrom
feature/162-custom-min-max

Conversation

@yfre

@yfre yfre commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #162

What

The window covering tilt angle characteristics get DEFAULT_MIN_VALUE / DEFAULT_MAX_VALUE constants and a constructor taking minValue, maxValue before the existing parameters. The existing constructor delegates with −90/90, the same pattern as ColorTemperatureCharacteristic.

Covered: Current/TargetHorizontalTiltAngle and Current/TargetVerticalTiltAngle.

Use case: blinds whose slats only tilt part of the −90..90° range, e.g. 0..90°.

Following review, the percentage characteristics and hue were dropped, since their ranges are fixed by definition. The Slat service tilt angles (CurrentTiltAngle, TargetTiltAngle) were dropped too: the Home app shows no control for the Slat service, so a custom range can't be verified there.

Compatibility

No breaking changes: existing constructors and their serialized output are unchanged, and only constructors and constants are added.

Testing

mvn -B package on JDK 11: all tests pass. CustomTiltAngleRangeTest checks:

  • the default constructors produce the same JSON as master
  • the custom constructor advertises the given range

Home app, with a test bridge exposing window coverings with horizontal tilt 0..90 and −30..60, vertical tilt 0..90, and a default −90..90 control:

  • the tilt slider only covers the custom range
  • both ends of the range are reachable
  • Home never wrote a value outside the range

)

Add DEFAULT_MIN_VALUE/DEFAULT_MAX_VALUE (and DEFAULT_STEP for float
characteristics) and a constructor taking min/max (and step) to 19
characteristics that only supported fixed ranges, following the pattern
of RotationSpeedCharacteristic. Existing constructors delegate with the
previous values, so their serialized output is unchanged.
@ccutrer

ccutrer commented Oct 19, 2026

Copy link
Copy Markdown
Member
  • Do any of these even make sense? Most are percentage characteristics that I'm having a hard time seeing why a range besides 0-100 would make sense. HueCharacteristic almost certainly should never be anything besides 0-360°. I could see tilt characteristics making sense to have a limited range, but I'd like to see that testing has actually been done with Home app that it can respect valid ranges besides -90 to 90°.

Percentage characteristics and hue have fixed ranges by definition, so
only the tilt angles keep the min/max constructors.
@yfre yfre changed the title Add custom min/max to remaining range characteristics Add custom min/max to tilt angle characteristics Oct 19, 2026
The Home app shows no control for the Slat service, so a custom range
cannot be verified there.
@yfre yfre changed the title Add custom min/max to tilt angle characteristics Add custom min/max to window covering tilt angle characteristics Nov 3, 2026
@yfre

yfre commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@ccutrer Thanks, good points. I tested all of them in the Home app with a small test bridge.

Window covering tilt works well. With −30..60, the slider only shows −30..60. 0..90 horizontal and vertical work too. Both ends are reachable, and Home never sent anything outside the range.

Percentages and hue don’t. Brightness 10..80, position 0..50 and hue 0..180 still show the full slider or colour wheel. Go past the limit and it jumps back. Humidifier threshold 30..60 is worse: the slider gets stuck and Home only sends 30. So I dropped them.

I dropped the slat tilt angles too. Home shows no tilt control for the Slat service. Not standalone, and not linked to a fan, blind or air purifier.

So the PR now only covers window covering tilt. please review

IMG_3990 IMG_3987

This branch has not been deployed

No deployments
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.

add custom min/max values for remaining characteristics

2 participants