GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add custom min/max to window covering tilt angle characteristics by yfre · Pull Request #209 · hap-java/HAP-Java

Conversation

@yfre

@yfre yfre commented Oct 18, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
udaw
Add custom min/max constructors to remaining range characteristics (#162
3389210
)

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.
This was referenced Oct 18, 2026
Add custom valid values to remaining enum characteristics #210
Closed
Add optional Mute characteristic to Doorbell service #211
Merged
@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°.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

udaw
Limit custom min/max to tilt angle characteristics
a2a6bff
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
Eugen
Drop slat tilt angle characteristics from custom min/max
3f844c2
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
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

add custom min/max values for remaining characteristics

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@yfre @ccutrer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.