Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize settings and sensors into properties #1753

Merged
merged 1 commit into from Mar 5, 2023

Commits on Mar 5, 2023

  1. Generalize settings and sensors into properties

    This removes the unnecessary division between sensors and settings in favor of just having "properties" that can have different access flags.
    
    This will greatly simplify the API as all properties are alike, the difference is just in the access flags.
    
    The earlier API to get settable properties (settings) and readable properties (sensors) is kept intact for the time being.
    
    * SettingDescriptor is no more, all readable and writable properties are described using PropertyDescriptors.
        * SettingType is replaced with PropertyConstraint to allow signaling allowed ranges or choices.
        * EnumSettingDescriptor is now EnumDescriptor
        * NumberSettingDescriptor is now RangeDescriptor
    
    * Add 'access' to Descriptor
        * This will also allow for generic `descriptors` interface in the future, if needed.
    
    * Add 'property' to Descriptor
        * None for actions, allwos more generic interface for properties.
    
    * Add 'properties' method to 'Device' to get all property descriptors. 'settings' and 'sensors' return a filtered dict based on the properties for backwards compat.
    rytilahti committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    d01acfa View commit details
    Browse the repository at this point in the history