Update light transition module to work with child devices (#1017)

Fixes module to work with child devices, i.e. ks240
Interrogates the data to see whether maximums are available.
Fixes a bug whereby setting a duration while the feature is not
enabled does not actually enable it.
This commit is contained in:
Steven B
2024-06-27 18:52:54 +01:00
committed by GitHub
parent cf24a94526
commit 2a62849987
8 changed files with 304 additions and 77 deletions

View File

@@ -107,6 +107,8 @@ class Feature:
Number = Type.Number
Choice = Type.Choice
DEFAULT_MAX = 2**16 # Arbitrary max
class Category(Enum):
"""Category hint to allow feature grouping."""
@@ -155,7 +157,7 @@ class Feature:
#: Minimum value
minimum_value: int = 0
#: Maximum value
maximum_value: int = 2**16 # Arbitrary max
maximum_value: int = DEFAULT_MAX
#: Attribute containing the name of the range getter property.
#: If set, this property will be used to set *minimum_value* and *maximum_value*.
range_getter: str | None = None