Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed May 31, 2023
1 parent 01610a3 commit cfe565a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The `adaptive_lighting.manual_control` event is fired when a light is marked as
- [:memo: Options](#memo-options)
- [:hammer_and_wrench: Services](#hammer_and_wrench-services)
- [`adaptive_lighting.apply`](#adaptive_lightingapply)
- [`adaptive_lighting.turn_on`, `adaptive_lighting.turn_off`, `adaptive_lighting.toggle`](#adaptive_lightingturn_on-adaptive_lightingturn_off-adaptive_lightingtoggle)
- [`adaptive_lighting.set_manual_control`](#adaptive_lightingset_manual_control)
- [`adaptive_lighting.change_switch_settings`](#adaptive_lightingchange_switch_settings)
- [:robot: Automation examples](#robot-automation-examples)
Expand Down Expand Up @@ -176,6 +177,25 @@ adaptive_lighting:
| `turn_on_lights` | Whether to turn on lights that are currently off. 🔆 | ❌ | bool |

<!-- END_OUTPUT -->


#### `adaptive_lighting.turn_on`, `adaptive_lighting.turn_off`, `adaptive_lighting.toggle`

`adaptive_lighting.turn_on`, `adaptive_lighting.turn_off`, `adaptive_lighting.toggle` turn Adaptive Lighting on or off.

TODO: ...

<!-- START_CODE -->
<!-- from homeassistant.components.adaptive_lighting import _docs_helpers -->
<!-- print(_docs_helpers.generate_turn_on_markdown_table()) -->
<!-- END_CODE -->

<!-- START_OUTPUT -->
<!-- THIS CONTENT IS AUTOMATICALLY GENERATED -->

<!-- END_OUTPUT -->


#### `adaptive_lighting.set_manual_control`

`adaptive_lighting.set_manual_control` can mark (or unmark) whether a light is "manually controlled", meaning that when a light has `manual_control`, the light is not adapted.
Expand Down
5 changes: 5 additions & 0 deletions custom_components/adaptive_lighting/_docs_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
DOCS,
DOCS_APPLY,
DOCS_MANUAL_CONTROL,
SERVICE_TOGGLE_SCHEMA,
SET_MANUAL_CONTROL_SCHEMA,
VALIDATION_TUPLES,
apply_service_schema,
Expand Down Expand Up @@ -110,6 +111,10 @@ def generate_apply_markdown_table():
return _generate_service_markdown_table(apply_service_schema(), DOCS_APPLY)


def generate_turn_on_markdown_table():
return _generate_service_markdown_table(SERVICE_TOGGLE_SCHEMA, DOCS_APPLY)


def generate_set_manual_control_markdown_table():
return _generate_service_markdown_table(
SET_MANUAL_CONTROL_SCHEMA, DOCS_MANUAL_CONTROL
Expand Down
12 changes: 6 additions & 6 deletions custom_components/adaptive_lighting/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,12 @@
"Which switch to target in this service call. Options: "
'"main" (default, targets the main switch), "sleep", "brightness", "color"'
)
DOCS[
SERVICE_TURN_ON
] = "Turn on an Adaptive Lighting main/sleep/brightness/color switch"
DOCS[
SERVICE_TURN_OFF
] = "Turn off an Adaptive Lighting main/sleep/brightness/color switch"
DOCS[SERVICE_TURN_ON] = (
"Turn on an Adaptive Lighting" " main/sleep/brightness/color switch"
)
DOCS[SERVICE_TURN_OFF] = (
"Turn off an Adaptive Lighting" " main/sleep/brightness/color switch"
)
DOCS[SERVICE_TOGGLE] = "Toggle an Adaptive Lighting main/sleep/brightness/color switch"

TURNING_OFF_DELAY = 5
Expand Down

0 comments on commit cfe565a

Please sign in to comment.