-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed commit. More info on GitHub
- Loading branch information
Showing
11 changed files
with
532 additions
and
1 deletion.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
This module contains definition of Fan Speed capability | ||
""" | ||
|
||
|
||
class FanSpeed(object): | ||
""" | ||
Fan Speed devices are devices that have a build-in and externally | ||
controllable (at least monitored) fan. For example, that can be | ||
heaters, some HVACs and fans itself (as separate devices). | ||
The speed of some fans can be changed only by a constant step. | ||
For such cases (for example, for table fans with only 3 speeds), | ||
the whole range will be separated on the corresponding number | ||
of segments. For example, it'll be 0-25, 26-50, 51-75 and 76-100 | ||
for a generic fan with speeds 0 (stopped), 1, 2 and 3 correspondingly. | ||
""" | ||
_capability_name = 'fan_speed' | ||
_commands = ('set_fan_speed',) | ||
|
||
@property | ||
def fan_speed(self) -> float: | ||
""" | ||
Returns the current fan speed of a Thing in values from 0.0 to 100.0. | ||
:return: the current fan speed | ||
""" | ||
raise NotImplementedError() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
This module contains definition of Has Color Temperature capability | ||
""" | ||
|
||
|
||
class HasColorTemperature(object): | ||
""" | ||
Color Temperature devices are devices that have the "color temperature" | ||
property. The color temperature is expressed in Kelvins and can take integer | ||
values from 1000 to 10000 including. The color temperature of light source | ||
or other Actuator can be set with ``set_color_temp`` command. | ||
If the Thing doesn't support specified color temperature value | ||
(i.e. it's too low or too high for this Thing), then the color temperature | ||
will be set to the nearest supported value. | ||
""" | ||
_capability_name = 'has_color_temp' | ||
_commands = ('set_color_temp',) | ||
|
||
@property | ||
def color_temp(self) -> int: | ||
""" | ||
Returns the current color temperature of a Thing in Kelvins | ||
:return: the current color temperature in Kelvins | ||
""" | ||
raise NotImplementedError() |
Oops, something went wrong.