Repository navigation
Conversation
) 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.
|
Percentage characteristics and hue have fixed ranges by definition, so only the tilt angles keep the min/max constructors.
The Home app shows no control for the Slat service, so a custom range cannot be verified there.
|
@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 |
Closes #162
What
The window covering tilt angle characteristics get
DEFAULT_MIN_VALUE/DEFAULT_MAX_VALUEconstants and a constructor takingminValue, maxValuebefore the existing parameters. The existing constructor delegates with −90/90, the same pattern asColorTemperatureCharacteristic.Covered:
Current/TargetHorizontalTiltAngleandCurrent/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 packageon JDK 11: all tests pass.CustomTiltAngleRangeTestchecks: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: