Skip to content

Commit

Permalink
docs(predefined): add missing predefined action
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviml committed Feb 6, 2021
1 parent 55bb369 commit fa15b04
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 51 deletions.
4 changes: 2 additions & 2 deletions apps/controllerx/cx_const.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any, Awaitable, Callable, Dict, List, Mapping, Tuple, Union
from typing import Any, Awaitable, Callable, Dict, List, Tuple, Union

ActionFunction = Callable[..., Awaitable[Any]]
ActionFunctionWithParams = Tuple[ActionFunction, Tuple]
TypeAction = Union[ActionFunction, ActionFunctionWithParams]
ActionEvent = Union[str, int]
PredefinedActionsMapping = Dict[str, TypeAction]
DefaultActionsMapping = Mapping[ActionEvent, str]
DefaultActionsMapping = Dict[ActionEvent, str]

CustomAction = Union[str, Dict[str, Any]]
CustomActions = Union[List[CustomAction], CustomAction]
Expand Down
2 changes: 1 addition & 1 deletion apps/controllerx/cx_core/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async def init(self) -> None:

if custom_mapping is None:
default_actions_mapping = self.get_default_actions_mapping(self.integration)
self.actions_mapping = self.parse_action_mapping(default_actions_mapping)
self.actions_mapping = self.parse_action_mapping(default_actions_mapping) # type: ignore
else:
self.actions_mapping = self.parse_action_mapping(custom_mapping)

Expand Down
97 changes: 49 additions & 48 deletions docs/advanced/predefined-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,54 +11,55 @@ Here you can find a list of predefined actions (one of the [action types](action

When using a [light controller](/controllerx/start/type-configuration#light-controller) (e.g. `E1743Controller`) or `LightController`, the following actions can be used as a predefined action:

| value | description |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `"on"` | It turns on the light |
| `"off"` | It turns off the light |
| `toggle` | It toggles the light |
| `toggle_full_brightness` | It toggles the light, setting the brightness to the maximum value when turning on. |
| `toggle_full_white_value` | It toggles the light, setting the white value to the maximum value when turning on. |
| `toggle_full_color_temp` | It toggles the light, setting the color temperature to the maximum value when turning on. |
| `toggle_min_brightness` | It toggles the light, setting the brightness to the minimum value when turning on. |
| `toggle_min_white_value` | It toggles the light, setting the white value to the minimum value when turning on. |
| `toggle_min_color_temp` | It toggles the light, setting the color temperature to the minimum value when turning on. |
| `release` | It stops `hold` actions |
| `on_full_brightness` | It puts the brightness to the maximum value |
| `on_full_white_value` | It puts the white value to the maximum value |
| `on_full_color_temp` | It puts the color temp to the maximum value |
| `on_min_brightness` | It puts the brightness to the minimum value |
| `on_min_white_value` | It puts the white value to the minimum value |
| `on_min_color_temp` | It puts the color temp to the minimum value |
| `set_half_brightness` | It sets the brightness to 50% |
| `set_half_white_value` | It sets the white value to 50% |
| `set_half_color_temp` | It sets the color temp to 50% |
| `sync` | It syncs the light(s) to full brightness and white colour or 2700K (370 mireds) |
| `click_brightness_up` | It brights up accordingly with the `manual_steps` attribute |
| `click_brightness_down` | It brights down accordingly with the `manual_steps` attribute |
| `click_white_value_up` | It turns the white value up accordingly with the `manual_steps` attribute |
| `click_white_value_down` | It turns the white value down accordingly with the `manual_steps` attribute |
| `click_color_up` | It turns the color up accordingly with the `manual_steps` attribute |
| `click_color_down` | It turns the color down accordingly with the `manual_steps` attribute |
| `click_colortemp_up` | It turns the color temp up accordingly with the `manual_steps` attribute |
| `click_colortemp_down` | It turns the color temp down accordingly with the `manual_steps` attribute |
| `click_xycolor_up` | It turns the xy color up accordingly with the `manual_steps` attribute |
| `click_xycolor_down` | It turns the xy color down accordingly with the `manual_steps` attribute |
| `hold_brightness_up` | It brights up until release accordingly with the `automatic_steps` attribute |
| `hold_brightness_down` | It brights down until release accordingly with the `automatic_steps` attribute |
| `hold_brightness_toggle` | It brights up/down until release accordingly with the `automatic_steps` attribute and alternates in each click |
| `hold_white_value_up` | It turns the white value up until release accordingly with the `automatic_steps` attribute |
| `hold_white_value_down` | It turns the white value down until release accordingly with the `automatic_steps` attribute |
| `hold_white_value_toggle` | It turns the white value up/down until release accordingly with the `automatic_steps` attribute and alternates in each click |
| `hold_color_up` | It turns the color up until release accordingly with the `automatic_steps` attribute |
| `hold_color_down` | It turns the color down until release accordingly with the `automatic_steps` attribute |
| `hold_color_toggle` | It turns the color up/down until release accordingly with the `automatic_steps` attribute and alternates in each click |
| `hold_colortemp_up` | It turns the color temp up until release accordingly with the `automatic_steps` attribute |
| `hold_colortemp_down` | It turns the color temp down until release accordingly with the `automatic_steps` attribute |
| `hold_colortemp_toggle` | It turns the color temp up/down until release accordingly with the `automatic_steps` attribute and alternates in each click |
| `hold_xycolor_up` | It turns the xy color up until release accordingly with the `automatic_steps` attribute |
| `hold_xycolor_down` | It turns the xy color down until release accordingly with the `automatic_steps` attribute |
| `hold_xycolor_toggle` | It turns the xy color up/down until release accordingly with the `automatic_steps` attribute and alternates in each click |
| `xycolor_from_controller` | It changes the color of the light from the value sent by the controller (if supported) |
| value | description |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `"on"` | It turns on the light |
| `"off"` | It turns off the light |
| `toggle` | It toggles the light |
| `toggle_full_brightness` | It toggles the light, setting the brightness to the maximum value when turning on. |
| `toggle_full_white_value` | It toggles the light, setting the white value to the maximum value when turning on. |
| `toggle_full_color_temp` | It toggles the light, setting the color temperature to the maximum value when turning on. |
| `toggle_min_brightness` | It toggles the light, setting the brightness to the minimum value when turning on. |
| `toggle_min_white_value` | It toggles the light, setting the white value to the minimum value when turning on. |
| `toggle_min_color_temp` | It toggles the light, setting the color temperature to the minimum value when turning on. |
| `release` | It stops `hold` actions |
| `on_full_brightness` | It puts the brightness to the maximum value |
| `on_full_white_value` | It puts the white value to the maximum value |
| `on_full_color_temp` | It puts the color temp to the maximum value |
| `on_min_brightness` | It puts the brightness to the minimum value |
| `on_min_white_value` | It puts the white value to the minimum value |
| `on_min_color_temp` | It puts the color temp to the minimum value |
| `set_half_brightness` | It sets the brightness to 50% |
| `set_half_white_value` | It sets the white value to 50% |
| `set_half_color_temp` | It sets the color temp to 50% |
| `sync` | It syncs the light(s) to full brightness and white colour or 2700K (370 mireds) |
| `click_brightness_up` | It brights up accordingly with the `manual_steps` attribute |
| `click_brightness_down` | It brights down accordingly with the `manual_steps` attribute |
| `click_white_value_up` | It turns the white value up accordingly with the `manual_steps` attribute |
| `click_white_value_down` | It turns the white value down accordingly with the `manual_steps` attribute |
| `click_color_up` | It turns the color up accordingly with the `manual_steps` attribute |
| `click_color_down` | It turns the color down accordingly with the `manual_steps` attribute |
| `click_colortemp_up` | It turns the color temp up accordingly with the `manual_steps` attribute |
| `click_colortemp_down` | It turns the color temp down accordingly with the `manual_steps` attribute |
| `click_xycolor_up` | It turns the xy color up accordingly with the `manual_steps` attribute |
| `click_xycolor_down` | It turns the xy color down accordingly with the `manual_steps` attribute |
| `hold_brightness_up` | It brights up until release accordingly with the `automatic_steps` attribute |
| `hold_brightness_down` | It brights down until release accordingly with the `automatic_steps` attribute |
| `hold_brightness_toggle` | It brights up/down until release accordingly with the `automatic_steps` attribute and alternates in each click |
| `hold_white_value_up` | It turns the white value up until release accordingly with the `automatic_steps` attribute |
| `hold_white_value_down` | It turns the white value down until release accordingly with the `automatic_steps` attribute |
| `hold_white_value_toggle` | It turns the white value up/down until release accordingly with the `automatic_steps` attribute and alternates in each click |
| `hold_color_up` | It turns the color up until release accordingly with the `automatic_steps` attribute |
| `hold_color_down` | It turns the color down until release accordingly with the `automatic_steps` attribute |
| `hold_color_toggle` | It turns the color up/down until release accordingly with the `automatic_steps` attribute and alternates in each click |
| `hold_colortemp_up` | It turns the color temp up until release accordingly with the `automatic_steps` attribute |
| `hold_colortemp_down` | It turns the color temp down until release accordingly with the `automatic_steps` attribute |
| `hold_colortemp_toggle` | It turns the color temp up/down until release accordingly with the `automatic_steps` attribute and alternates in each click |
| `hold_xycolor_up` | It turns the xy color up until release accordingly with the `automatic_steps` attribute |
| `hold_xycolor_down` | It turns the xy color down until release accordingly with the `automatic_steps` attribute |
| `hold_xycolor_toggle` | It turns the xy color up/down until release accordingly with the `automatic_steps` attribute and alternates in each click |
| `xycolor_from_controller` | It changes the xy color of the light from the value sent by the controller (if supported) |
| `colortemp_from_controller` | It changes the color temperature of the light from the value sent by the controller (if supported) |

## Media Player

Expand Down

0 comments on commit fa15b04

Please sign in to comment.