Add README, sunrise alarm, CCT (white/warm) support and configs
- README: WLED pull/push usage, sunrise alarm, white vs warm (CCT) section - wled_push: --cct 0-255 for segment 0 color temperature - wled_config: white.json, warm.json, sunrise presets; updated state/full Made-with: Cursor
This commit is contained in:
@@ -55,6 +55,7 @@ def main():
|
||||
p.add_argument("--off", action="store_true", help="Turn off")
|
||||
p.add_argument("--toggle", "-t", action="store_true", dest="toggle", help="Toggle on/off")
|
||||
p.add_argument("--bri", type=int, metavar="0-255", help="Brightness")
|
||||
p.add_argument("--cct", type=int, metavar="0-255", help="Color temp: 0=warm, 255=cool white (segment 0)")
|
||||
p.add_argument("--preset", "-p", type=int, metavar="ID", help="Load preset by ID")
|
||||
p.add_argument("--v", action="store_true", help="Return full state in response")
|
||||
args = p.parse_args()
|
||||
@@ -73,6 +74,15 @@ def main():
|
||||
payload["on"] = "t"
|
||||
if args.bri is not None:
|
||||
payload["bri"] = max(0, min(255, args.bri))
|
||||
if args.cct is not None:
|
||||
cct = max(0, min(255, args.cct))
|
||||
payload.setdefault("seg", [])
|
||||
seg0 = next((s for s in payload["seg"] if s.get("id") == 0), payload["seg"][0] if payload["seg"] else None)
|
||||
if seg0 is None:
|
||||
payload["seg"].insert(0, {"id": 0, "fx": 0, "cct": cct})
|
||||
else:
|
||||
seg0["cct"] = cct
|
||||
seg0["fx"] = 0 # Solid so CCT is visible
|
||||
if args.preset is not None:
|
||||
payload["ps"] = args.preset
|
||||
if args.v:
|
||||
|
||||
Reference in New Issue
Block a user