Skip to content

Commit 9c3f4ab

Browse files
committed
Make transition not required again
1 parent 7c33058 commit 9c3f4ab

4 files changed

Lines changed: 24 additions & 19 deletions

File tree

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@ adaptive_lighting:
195195

196196
<!-- OUTPUT:START -->
197197
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
198-
| Service data attribute | Description | Required | Type |
199-
|:-------------------------|:--------------------------------------------------------------------------------------|:-----------|:---------------------|
200-
| `entity_id` | The `entity_id` of the switch with the settings to apply. 📝 | ✅ | list of `entity_id`s |
201-
| `lights` | A light (or list of lights) to apply the settings to. 💡 | ❌ | list of `entity_id`s |
202-
| `transition` | Duration of transition when lights change, in seconds. 🕑 | | `float` 0-6553 |
203-
| `adapt_brightness` | Whether to adapt the brightness of the light. 🌞 | ❌ | bool |
204-
| `adapt_color` | Whether to adapt the color on supporting lights. 🌈 | ❌ | bool |
205-
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | ❌ | bool |
206-
| `turn_on_lights` | Whether to turn on lights that are currently off. 🔆 | ❌ | bool |
198+
| Service data attribute | Description | Required | Type |
199+
|:-------------------------|:--------------------------------------------------------------------------------------|:-----------|:-----------------------|
200+
| `entity_id` | The `entity_id` of the switch with the settings to apply. 📝 | ✅ | list of `entity_id`s |
201+
| `lights` | A light (or list of lights) to apply the settings to. 💡 | ❌ | list of `entity_id`s |
202+
| `transition` | Duration of transition when lights change, in seconds. 🕑 | | `float` 0-6553 or None |
203+
| `adapt_brightness` | Whether to adapt the brightness of the light. 🌞 | ❌ | bool |
204+
| `adapt_color` | Whether to adapt the color on supporting lights. 🌈 | ❌ | bool |
205+
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | ❌ | bool |
206+
| `turn_on_lights` | Whether to turn on lights that are currently off. 🔆 | ❌ | bool |
207207

208208
<!-- OUTPUT:END -->
209209
#### `adaptive_lighting.set_manual_control`

custom_components/adaptive_lighting/_docs_helpers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def _type_to_str(type_: Any) -> str: # noqa: PLR0911
4040
"""Convert a (voluptuous) type to a string."""
4141
if type_ == cv.entity_ids:
4242
return "list of `entity_id`s"
43+
if type_ is None:
44+
return "None"
4345
if type_ in (bool, int, float, str):
4446
return f"`{type_.__name__}`"
4547
if type_ == cv.boolean:

custom_components/adaptive_lighting/const.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,10 @@ def apply_service_schema() -> vol.Schema:
465465
{
466466
vol.Optional(CONF_ENTITY_ID): cv.entity_ids, # type: ignore[arg-type]
467467
vol.Optional(CONF_LIGHTS, default=[]): cv.entity_ids, # type: ignore[arg-type]
468-
vol.Optional(CONF_TRANSITION): VALID_TRANSITION,
468+
vol.Optional(
469+
CONF_TRANSITION,
470+
default=None,
471+
): vol.Any(VALID_TRANSITION, None),
469472
vol.Optional(ATTR_ADAPT_BRIGHTNESS, default=True): cv.boolean,
470473
vol.Optional(ATTR_ADAPT_COLOR, default=True): cv.boolean,
471474
vol.Optional(CONF_PREFER_RGB_COLOR, default=False): cv.boolean,

docs/services.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ Applies the current Adaptive Lighting settings to lights on demand. Useful for f
1818
<!-- CODE:END -->
1919
<!-- OUTPUT:START -->
2020
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
21-
| Service data attribute | Description | Required | Type |
22-
|:-------------------------|:--------------------------------------------------------------------------------------|:-----------|:---------------------|
23-
| `entity_id` | The `entity_id` of the switch with the settings to apply. 📝 || list of `entity_id`s |
24-
| `lights` | A light (or list of lights) to apply the settings to. 💡 || list of `entity_id`s |
25-
| `transition` | Duration of transition when lights change, in seconds. 🕑 | | `float` 0-6553 |
26-
| `adapt_brightness` | Whether to adapt the brightness of the light. 🌞 || bool |
27-
| `adapt_color` | Whether to adapt the color on supporting lights. 🌈 || bool |
28-
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 || bool |
29-
| `turn_on_lights` | Whether to turn on lights that are currently off. 🔆 || bool |
21+
| Service data attribute | Description | Required | Type |
22+
|:-------------------------|:--------------------------------------------------------------------------------------|:-----------|:-----------------------|
23+
| `entity_id` | The `entity_id` of the switch with the settings to apply. 📝 || list of `entity_id`s |
24+
| `lights` | A light (or list of lights) to apply the settings to. 💡 || list of `entity_id`s |
25+
| `transition` | Duration of transition when lights change, in seconds. 🕑 | | `float` 0-6553 or None |
26+
| `adapt_brightness` | Whether to adapt the brightness of the light. 🌞 || bool |
27+
| `adapt_color` | Whether to adapt the color on supporting lights. 🌈 || bool |
28+
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 || bool |
29+
| `turn_on_lights` | Whether to turn on lights that are currently off. 🔆 || bool |
3030

3131
<!-- OUTPUT:END -->
3232

0 commit comments

Comments
 (0)