Skip to content

Commit cfe565a

Browse files
committedMay 31, 2023
Add docs
1 parent 01610a3 commit cfe565a

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed
 

‎README.md

+20
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ The `adaptive_lighting.manual_control` event is fired when a light is marked as
4545
- [:memo: Options](#memo-options)
4646
- [:hammer_and_wrench: Services](#hammer_and_wrench-services)
4747
- [`adaptive_lighting.apply`](#adaptive_lightingapply)
48+
- [`adaptive_lighting.turn_on`, `adaptive_lighting.turn_off`, `adaptive_lighting.toggle`](#adaptive_lightingturn_on-adaptive_lightingturn_off-adaptive_lightingtoggle)
4849
- [`adaptive_lighting.set_manual_control`](#adaptive_lightingset_manual_control)
4950
- [`adaptive_lighting.change_switch_settings`](#adaptive_lightingchange_switch_settings)
5051
- [:robot: Automation examples](#robot-automation-examples)
@@ -176,6 +177,25 @@ adaptive_lighting:
176177
| `turn_on_lights` | Whether to turn on lights that are currently off. 🔆 | ❌ | bool |
177178

178179
<!-- END_OUTPUT -->
180+
181+
182+
#### `adaptive_lighting.turn_on`, `adaptive_lighting.turn_off`, `adaptive_lighting.toggle`
183+
184+
`adaptive_lighting.turn_on`, `adaptive_lighting.turn_off`, `adaptive_lighting.toggle` turn Adaptive Lighting on or off.
185+
186+
TODO: ...
187+
188+
<!-- START_CODE -->
189+
<!-- from homeassistant.components.adaptive_lighting import _docs_helpers -->
190+
<!-- print(_docs_helpers.generate_turn_on_markdown_table()) -->
191+
<!-- END_CODE -->
192+
193+
<!-- START_OUTPUT -->
194+
<!-- THIS CONTENT IS AUTOMATICALLY GENERATED -->
195+
196+
<!-- END_OUTPUT -->
197+
198+
179199
#### `adaptive_lighting.set_manual_control`
180200

181201
`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.

‎custom_components/adaptive_lighting/_docs_helpers.py

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
DOCS,
1010
DOCS_APPLY,
1111
DOCS_MANUAL_CONTROL,
12+
SERVICE_TOGGLE_SCHEMA,
1213
SET_MANUAL_CONTROL_SCHEMA,
1314
VALIDATION_TUPLES,
1415
apply_service_schema,
@@ -110,6 +111,10 @@ def generate_apply_markdown_table():
110111
return _generate_service_markdown_table(apply_service_schema(), DOCS_APPLY)
111112

112113

114+
def generate_turn_on_markdown_table():
115+
return _generate_service_markdown_table(SERVICE_TOGGLE_SCHEMA, DOCS_APPLY)
116+
117+
113118
def generate_set_manual_control_markdown_table():
114119
return _generate_service_markdown_table(
115120
SET_MANUAL_CONTROL_SCHEMA, DOCS_MANUAL_CONTROL

‎custom_components/adaptive_lighting/const.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,12 @@
211211
"Which switch to target in this service call. Options: "
212212
'"main" (default, targets the main switch), "sleep", "brightness", "color"'
213213
)
214-
DOCS[
215-
SERVICE_TURN_ON
216-
] = "Turn on an Adaptive Lighting main/sleep/brightness/color switch"
217-
DOCS[
218-
SERVICE_TURN_OFF
219-
] = "Turn off an Adaptive Lighting main/sleep/brightness/color switch"
214+
DOCS[SERVICE_TURN_ON] = (
215+
"Turn on an Adaptive Lighting" " main/sleep/brightness/color switch"
216+
)
217+
DOCS[SERVICE_TURN_OFF] = (
218+
"Turn off an Adaptive Lighting" " main/sleep/brightness/color switch"
219+
)
220220
DOCS[SERVICE_TOGGLE] = "Toggle an Adaptive Lighting main/sleep/brightness/color switch"
221221

222222
TURNING_OFF_DELAY = 5

0 commit comments

Comments
 (0)
Please sign in to comment.