Support for on_off_gradually v2+ (#793)

Previously, only v1 of on_off_gradually is supported, and the newer versions are not backwards compatible.
This PR adds support for the newer versions of the component, and implements `number` type for `Feature` to expose the transition time selection.
This also adds a new `supported_version` property to the main module API.
This commit is contained in:
Teemu R
2024-02-24 02:16:43 +01:00
committed by GitHub
parent a73e2a9ede
commit cbf82c9498
4 changed files with 159 additions and 16 deletions

View File

@@ -80,3 +80,8 @@ class SmartModule(Module):
return next(iter(filtered_data.values()))
return filtered_data
@property
def supported_version(self) -> int:
"""Return version supported by the device."""
return self._device._components[self.REQUIRED_COMPONENT]