Skip to content

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

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

yfre wants to merge 2 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 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: CurrentTiltAngle, TargetTiltAngle (slat), and Current/TargetHorizontalTiltAngle and Current/TargetVerticalTiltAngle (window covering).

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 from this PR, since their ranges are fixed by definition.

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

Still to do before merging: verify in the Home app that the tilt control respects a custom range such as 0..90.

)

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

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