Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
11 changed files
with
293 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.