Print formatting for IotLightPreset (#1216)

Now prints presets as such:

```
[0] Hue:   0  Saturation:   0  Brightness/Value: 100  Temp: 6000  Custom: None  Mode: None  Id: None
[1] Hue:   0  Saturation:   0  Brightness/Value: 100  Temp: 2500  Custom: None  Mode: None  Id: None
[2] Hue:   0  Saturation:   0  Brightness/Value:  60  Temp: 2500  Custom: None  Mode: None  Id: None
[3] Hue: 240  Saturation: 100  Brightness/Value: 100  Temp:    0  Custom: None  Mode: None  Id: None
```
This commit is contained in:
Puxtril 2024-11-09 12:03:06 -05:00 committed by GitHub
parent 857a706649
commit 4e9a3e6b02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -130,8 +130,11 @@ def presets_list(dev: Device):
error("Presets not supported on device")
return
for preset in light_preset.preset_states_list:
echo(preset)
for idx, preset in enumerate(light_preset.preset_states_list):
echo(
f"[{idx}] Hue: {preset.hue:3} Saturation: {preset.saturation:3} "
f"Brightness/Value: {preset.brightness:3} Temp: {preset.color_temp:4}"
)
return light_preset.preset_states_list