Led light control, close #991 (#1106)

* feature: add leds panel

* Various refactors and improvements

* lint fixes

* led: use more columns for the selector

* leds: name in the title

* mainsail presets

* change sliders to horizontal to avoid visual bug, simplify defaults

* led: add a color preview and simplify methods to fix some issues

* simplify presets move all the logic to the panel

* led: change presets from names to previews

* preview label shows color, add vertical mode

* led: colored previews as rectangles instead of circles

---------

Co-authored-by: alfrix <alfredomonclus@gmail.com>
This commit is contained in:
Vasilyev_Andrey
2023-09-24 13:44:29 -07:00
committed by GitHub
parent 584e4fe902
commit 87d09036ee
5 changed files with 269 additions and 1 deletions

View File

@@ -39,3 +39,11 @@ class KlippyGcodes:
@staticmethod
def bed_mesh_save(profile):
return f"BED_MESH_PROFILE SAVE='{profile}'"
@staticmethod
def set_led_color(led, color):
return (
f'SET_LED LED="{led}" '
f'RED={color[0]} GREEN={color[1]} BLUE={color[2]} WHITE={color[3]} '
f'SYNC=0 TRANSMIT=1'
)