Add documentation for lifx.effect_sky (#33712)

* Add documentation for lifx.effect_sky

Signed-off-by: Avi Miller <me@dje.li>

* Implemented changes based on CodeRabbit AI review

Signed-off-by: Avi Miller <me@dje.li>

* Updated after review feedback

Signed-off-by: Avi Miller <me@dje.li>

---------

Signed-off-by: Avi Miller <me@dje.li>
This commit is contained in:
Avi Miller 2024-07-15 16:39:57 +10:00 committed by GitHub
parent 17b5173742
commit 8e33b04f01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -122,7 +122,7 @@ script:
### Hardware effects
The Flame (`lifx.effect_flame`), Morph (`lifx.effect_morph`) and Move (`lifx.effect_move`) effects are hardware-based and only work on specific LIFX devices. Flame and Morph are available on the LIFX Tile and Candle, while the Move effect requires a LIFX Z, Lightstrip, or Beam.
The Flame (`lifx.effect_flame`), Morph (`lifx.effect_morph`), Sky (`lifx.effect_sky`), and Move (`lifx.effect_move`) effects are hardware-based and only work on specific LIFX devices. Flame and Morph are available on the LIFX Tile, Candle, Path, Spot, and Ceiling while the Sky effect is only available on the Ceiling. The Move effect requires a LIFX Z, Lightstrip, Beam, Neon, or String.
All hardware-based effects can be stopped and started regardless of the device's power state, but the default behavior for each service is to turn the device on when starting an effect. Set the `power_on` attribute of the service to `false` to override this default.
@ -187,6 +187,51 @@ The device will be powered on by default, but this can be overridden by setting
| `theme` | The theme to use for the effect. Must be one of: `autumn`, `blissful`, `cheerful`, `dream`, `energizing`, `epic`, `exciting`, `focusing`, `halloween`, `hanukkah`, `holly`, `independence` `day`, `intense`, `mellow`, `peaceful`, `powerful`, `relaxing`, `santa`, `serene`, `soothing`, `sports`, `spring`, `tranquil`, `warming`.
| `power_on` | Whether to turn the light on before starting the effect (optional, default: true)
### Service `lifx.effect_sky`
Run a hardware-based effect on LIFX Ceiling devices that animates a sky scene across the device. The effect emulates three different types of sky: Sunrise, Sunset, and Clouds.
The default values and palette used by each sky type match those used by the LIFX smartphone app.
| Service data attribute | Description |
| ---------------------- | ----------------------------------------------------------------------------------- |
| `entity_id` | String or list of strings containing the `entity_id` of one or more Ceiling devices |
| `speed` | Duration in seconds for the effect to complete (optional, min: 1s, max: 86400s, default: 50s) |
| `palette` | A list of 6 colors to use for this effect (optional, see below for details) |
| `power_on` | Whether to turn the light on before starting the effect (optional, default: true) |
| `sky_type` | Either "Sunrise", "Sunset" or "Clouds" |
| `cloud_saturation_min` | The minimum cloud saturation for the Cloud sky type (optional, default: 50) |
| `cloud_saturation_max` | The maximum cloud saturation for the Cloud sky type (optional, default: 180) |
The palette for the Sky effect is shared between all three sky types. To use a custom palette, you must specify all six color values as hue (0-360), saturation (0-100), brightness (0-100), and kelvin (1500-9000) in the following order to modify the effect:
1. Sky: The color of the background sky when the Clouds sky type is used. All pixels on the light are given this color, and the "clouds" are made by applying a range of saturation values to the pixels.
2. Night sky: The starting (or finishing) color of the sky when no sun is visible for Sunrise or Sunset sky type. The Sunrise sky type starts with the light completely this color, then fades to a lighter color before starting to bring up the "sun". The Sunset sky type is the Sunrise sky type but in reverse.
3. Dawn sky: The color of the sky just as the sun appears. This is the color that the light fades to after starting at the "night sky" color.
4. Dawn sun: The color of the sun just as the sun appears. The background is still the "dawn sky" above, but now the sun is starting to rise with a warm color.
5. Full sun: The color of the sun as it covers the whole light. As the sun rises, it fades from the "dawn sun" color to this "full sun" color. The background stays at "dawn sky" but gets washed out by the bright sun colors.
6. Final sun: The color of the full sun at the end of the effect. After the sun has risen by covering the whole light, there is a phase where it fades to a cooler, bright daylight. This is the "final sun" color.
For example, the following YAML will trigger the Sky effect with the Sunrise sky type to run for five minutes using the same palette as the LIFX smartphone app:
```yaml
service: lifx.effect_sky
target:
entity_id: light.lifx_ceiling
data:
power_on: true
speed: 600
sky_type: Sunrise
cloud_saturation_min: 50
cloud_saturation_max: 180
palette:
- [200, 100, 100, 3500] # Sky: blue
- [241, 100, 1, 3500] # Night sky: dark purple
- [189, 100, 8, 3500] # Dawn sky: dark blue
- [40, 100, 100, 3500] # Dawn sun: warm white
- [40, 50, 100, 3500] # Full sun: medium white
- [40, 0, 100, 6500] # Final sun: cool white
```
### Service `lifx.effect_move`
Run a hardware-based effect on LIFX multizone devices that move the current colors on the device in a particular direction. The direction and speed of the animation are controlled by the `speed` and `direction` attributes. You can change the effect's colors while running using the `lifx.set_state` service.