From 7f5d16c10e4a4649b3708a129af5db39c1565cc6 Mon Sep 17 00:00:00 2001 From: Jesse Van Volkinburg Date: Wed, 29 Jul 2020 00:36:55 -0700 Subject: [PATCH] always use some non-black frame on live view mount --- lib/xebow_web/live/matrix_live.ex | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/xebow_web/live/matrix_live.ex b/lib/xebow_web/live/matrix_live.ex index d299c12..bd92070 100644 --- a/lib/xebow_web/live/matrix_live.ex +++ b/lib/xebow_web/live/matrix_live.ex @@ -6,31 +6,23 @@ defmodule XebowWeb.MatrixLive do alias RGBMatrix.Engine @layout Xebow.layout() - @black Chameleon.HSV.new(0, 0, 0) - @black_frame @layout - |> Layout.leds() - |> Map.new(fn led -> - {led.id, @black} - end) @impl Phoenix.LiveView def mount(_params, _session, socket) do {config, config_schema} = Xebow.get_animation_config() + {paint_fn, config_fn, frame} = register_with_engine!() initial_assigns = [ - leds: make_view_leds(@black_frame), + leds: make_view_leds(frame), config: config, config_schema: config_schema ] initial_assigns = if connected?(socket) do - {paint_fn, config_fn, frame} = register_with_engine!() - Keyword.merge(initial_assigns, paint_fn: paint_fn, - config_fn: config_fn, - leds: make_view_leds(frame) + config_fn: config_fn ) else initial_assigns