From cbd49db28c4323bb222eee62b40f38b16b850e7b Mon Sep 17 00:00:00 2001 From: Chris Rees Date: Wed, 22 Feb 2017 20:00:36 -0500 Subject: [PATCH 01/11] Poll Twitter using ExTwitter and the Streaming API --- apps/zapdos/.gitignore | 20 +++++++++++++ apps/zapdos/README.md | 19 ++++++++++++ apps/zapdos/config/config.exs | 37 +++++++++++++++++++++++ apps/zapdos/lib/zapdos.ex | 15 ++++++++++ apps/zapdos/lib/zapdos/application.ex | 20 +++++++++++++ apps/zapdos/lib/zapdos/color_parsing.ex | 15 ++++++++++ apps/zapdos/lib/zapdos/pluck.ex | 25 ++++++++++++++++ apps/zapdos/mix.exs | 40 +++++++++++++++++++++++++ apps/zapdos/test/test_helper.exs | 1 + apps/zapdos/test/zapdos_test.exs | 8 +++++ apps/zeus/lib/zeus.ex | 3 ++ apps/zeus/lib/zeus/color_parsing.ex | 8 ----- apps/zeus/mix.exs | 3 +- mix.lock | 2 ++ 14 files changed, 207 insertions(+), 9 deletions(-) create mode 100644 apps/zapdos/.gitignore create mode 100644 apps/zapdos/README.md create mode 100644 apps/zapdos/config/config.exs create mode 100644 apps/zapdos/lib/zapdos.ex create mode 100644 apps/zapdos/lib/zapdos/application.ex create mode 100644 apps/zapdos/lib/zapdos/color_parsing.ex create mode 100644 apps/zapdos/lib/zapdos/pluck.ex create mode 100644 apps/zapdos/mix.exs create mode 100644 apps/zapdos/test/test_helper.exs create mode 100644 apps/zapdos/test/zapdos_test.exs diff --git a/apps/zapdos/.gitignore b/apps/zapdos/.gitignore new file mode 100644 index 0000000..b6012c7 --- /dev/null +++ b/apps/zapdos/.gitignore @@ -0,0 +1,20 @@ +# The directory Mix will write compiled artifacts to. +/_build + +# If you run "mix test --cover", coverage assets end up here. +/cover + +# The directory Mix downloads your dependencies sources to. +/deps + +# Where 3rd-party dependencies like ExDoc output generated docs. +/doc + +# Ignore .fetch files in case you like to edit your project deps locally. +/.fetch + +# If the VM crashes, it generates a dump, let's ignore it too. +erl_crash.dump + +# Also ignore archive artifacts (built via "mix archive.build"). +*.ez diff --git a/apps/zapdos/README.md b/apps/zapdos/README.md new file mode 100644 index 0000000..0a77962 --- /dev/null +++ b/apps/zapdos/README.md @@ -0,0 +1,19 @@ +# Zapdos + +**TODO: Add description** + +## Installation + +If [available in Hex](https://hex.pm/docs/publish), the package can be installed +by adding `zapdos` to your list of dependencies in `mix.exs`: + +```elixir +def deps do + [{:zapdos, "~> 0.1.0"}] +end +``` + +Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) +and published on [HexDocs](https://hexdocs.pm). Once published, the docs can +be found at [https://hexdocs.pm/zapdos](https://hexdocs.pm/zapdos). + diff --git a/apps/zapdos/config/config.exs b/apps/zapdos/config/config.exs new file mode 100644 index 0000000..7de8b7e --- /dev/null +++ b/apps/zapdos/config/config.exs @@ -0,0 +1,37 @@ +# This file is responsible for configuring your application +# and its dependencies with the aid of the Mix.Config module. +use Mix.Config + +# This configuration is loaded before any dependency and is restricted +# to this project. If another project depends on this project, this +# file won't be loaded nor affect the parent project. For this reason, +# if you want to provide default values for your application for +# 3rd-party users, it should be done in your "mix.exs" file. + +# You can configure for your application as: +# +# config :zapdos, key: :value +# +# And access this configuration in your application as: +# +# Application.get_env(:zapdos, :key) +# +# Or configure a 3rd-party app: +# +# config :logger, level: :info +# + +# It is also possible to import configuration files, relative to this +# directory. For example, you can emulate configuration per environment +# by uncommenting the line below and defining dev.exs, test.exs and such. +# Configuration from the imported file will override the ones defined +# here (which is why it is important to import them last). +# +# import_config "#{Mix.env}.exs" + +config :extwitter, :oauth, [ + consumer_key: "", + consumer_secret: "", + access_token: "", + access_token_secret: "" +] diff --git a/apps/zapdos/lib/zapdos.ex b/apps/zapdos/lib/zapdos.ex new file mode 100644 index 0000000..5d96d2b --- /dev/null +++ b/apps/zapdos/lib/zapdos.ex @@ -0,0 +1,15 @@ +defmodule Zapdos do + alias Zapdos.ColorParsing + + @moduledoc """ + Documentation for Zapdos. + """ + + def get_tweets(query) do + ExTwitter.stream_filter(track: query) + |> Stream.map(fn(tweet) -> tweet.text end) + |> Stream.map(fn(text) -> ColorParsing.get_color(text) |> ColorParsing.hex_to_number |> IO.puts end) + |> Enum.to_list + end + +end diff --git a/apps/zapdos/lib/zapdos/application.ex b/apps/zapdos/lib/zapdos/application.ex new file mode 100644 index 0000000..5c83fc0 --- /dev/null +++ b/apps/zapdos/lib/zapdos/application.ex @@ -0,0 +1,20 @@ +defmodule Zapdos.Application do + # See http://elixir-lang.org/docs/stable/elixir/Application.html + # for more information on OTP Applications + @moduledoc false + + use Application + + def start(_type, _args) do + import Supervisor.Spec, warn: false + + # Define workers and child supervisors to be supervised + children = [ + ] + + # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html + # for other strategies and supported options + opts = [strategy: :one_for_one, name: Zapdos.Supervisor] + Supervisor.start_link(children, opts) + end +end diff --git a/apps/zapdos/lib/zapdos/color_parsing.ex b/apps/zapdos/lib/zapdos/color_parsing.ex new file mode 100644 index 0000000..bfa30ad --- /dev/null +++ b/apps/zapdos/lib/zapdos/color_parsing.ex @@ -0,0 +1,15 @@ +defmodule Zapdos.ColorParsing do + def get_color("Color: #" <> <> <> _), do: raw_hex + + def get_color(_), do: "FFFFFF" + + def parse_rgb_hex(rgb_value) do + [r1, r2, g1, g2, b1, b2] = rgb_value |> String.codepoints |> Enum.take(-6) + {hex_to_number(r1 <> r2), hex_to_number(g1 <> g2), hex_to_number(b1 <> b2)} + end + + def hex_to_number(hex_value) do + hex_value |> String.upcase |> Base.decode16! |> :binary.decode_unsigned + end +end + diff --git a/apps/zapdos/lib/zapdos/pluck.ex b/apps/zapdos/lib/zapdos/pluck.ex new file mode 100644 index 0000000..babf6df --- /dev/null +++ b/apps/zapdos/lib/zapdos/pluck.ex @@ -0,0 +1,25 @@ +defmodule Zapdos.Pluck do + use GenServer + + def start_link do + GenServer.start_link(__MODULE__, %{}) + end + + def init(state) do + schedule_work() # Schedule work to be performed at some point + {:ok, state} + end + + def handle_info(:work, state) do + # Do the work you desire here + Zapdos.get_tweets("#cmm_storm", 1) + |> IO.inspect + + schedule_work() # Reschedule once more + {:noreply, state} + end + + defp schedule_work() do + Process.send_after(self(), :work, 15 * 1000) + end +end diff --git a/apps/zapdos/mix.exs b/apps/zapdos/mix.exs new file mode 100644 index 0000000..be3aec0 --- /dev/null +++ b/apps/zapdos/mix.exs @@ -0,0 +1,40 @@ +defmodule Zapdos.Mixfile do + use Mix.Project + + def project do + [app: :zapdos, + version: "0.1.0", + build_path: "../../_build", + config_path: "../../config/config.exs", + deps_path: "../../deps", + lockfile: "../../mix.lock", + elixir: "~> 1.3", + build_embedded: Mix.env == :prod, + start_permanent: Mix.env == :prod, + deps: deps()] + end + + # Configuration for the OTP application + # + # Type "mix help compile.app" for more information + def application do + # Specify extra applications you'll use from Erlang/Elixir + [extra_applications: [:logger], + mod: {Zapdos.Application, []}] + end + + # Dependencies can be Hex packages: + # + # {:my_dep, "~> 0.3.0"} + # + # Or git/path repositories: + # + # {:my_dep, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} + # + # Type "mix help deps" for more examples and options + defp deps do + [ + {:extwitter, "~> 0.8"}, + ] + end +end diff --git a/apps/zapdos/test/test_helper.exs b/apps/zapdos/test/test_helper.exs new file mode 100644 index 0000000..869559e --- /dev/null +++ b/apps/zapdos/test/test_helper.exs @@ -0,0 +1 @@ +ExUnit.start() diff --git a/apps/zapdos/test/zapdos_test.exs b/apps/zapdos/test/zapdos_test.exs new file mode 100644 index 0000000..7d871ab --- /dev/null +++ b/apps/zapdos/test/zapdos_test.exs @@ -0,0 +1,8 @@ +defmodule ZapdosTest do + use ExUnit.Case + doctest Zapdos + + test "the truth" do + assert 1 + 1 == 2 + end +end diff --git a/apps/zeus/lib/zeus.ex b/apps/zeus/lib/zeus.ex index 770a835..01f4242 100644 --- a/apps/zeus/lib/zeus.ex +++ b/apps/zeus/lib/zeus.ex @@ -18,6 +18,9 @@ defmodule Zeus do # for other strategies and supported options opts = [strategy: :one_for_one, name: Zeus.Supervisor] Supervisor.start_link(children, opts) + + :timer.apply_interval(:timer.seconds(15), Zapdos, :get_tweet("#cmm_storm", 1)) + |> IO.puts end # Tell Phoenix to update the endpoint configuration diff --git a/apps/zeus/lib/zeus/color_parsing.ex b/apps/zeus/lib/zeus/color_parsing.ex index 7745ab1..91abd4b 100644 --- a/apps/zeus/lib/zeus/color_parsing.ex +++ b/apps/zeus/lib/zeus/color_parsing.ex @@ -1,11 +1,3 @@ defmodule Zeus.ColorParsing do - def parse_rgb_hex(rgb_value) do - [r1, r2, g1, g2, b1, b2] = rgb_value |> String.codepoints |> Enum.take(-6) - {hex_to_number(r1 <> r2), hex_to_number(g1 <> g2), hex_to_number(b1 <> b2)} - end - - def hex_to_number(hex_value) do - hex_value |> String.upcase |> Base.decode16! |> :binary.decode_unsigned - end end diff --git a/apps/zeus/mix.exs b/apps/zeus/mix.exs index 600e276..2fa5345 100644 --- a/apps/zeus/mix.exs +++ b/apps/zeus/mix.exs @@ -39,7 +39,8 @@ defmodule Zeus.Mixfile do {:phoenix_live_reload, "~> 1.0", only: :dev}, {:gettext, "~> 0.11"}, {:cowboy, "~> 1.0"}, - {:lightning, in_umbrella: true}] + {:lightning, in_umbrella: true}, + {:zapdos, in_umbrella: true}] end def aliases do diff --git a/mix.lock b/mix.lock index df4a9d5..6f6f958 100644 --- a/mix.lock +++ b/mix.lock @@ -2,6 +2,7 @@ "cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], []}, "distillery": {:hex, :distillery, "1.1.2", "4cf32ecc70ca7eecca9e52e111edf320bd78011050825863cd8bc7ffee686c5d", [:mix], []}, "elixir_make": {:hex, :elixir_make, "0.3.0", "285147fa943806eee82f6680b7b446b5569bcf3ee8328fa0a7c200ffc44fbaba", [:mix], []}, + "extwitter": {:hex, :extwitter, "0.8.2", "1b1b6842c6541ddfa468f1589b54c02a3b278b5ae74d6bed260655394d8cc7be", [:mix], [{:oauther, "~> 1.1", [hex: :oauther, optional: false]}, {:poison, "~> 2.0", [hex: :poison, optional: false]}]}, "fs": {:hex, :fs, "0.9.2", "ed17036c26c3f70ac49781ed9220a50c36775c6ca2cf8182d123b6566e49ec59", [:rebar], []}, "gettext": {:hex, :gettext, "0.13.1", "5e0daf4e7636d771c4c71ad5f3f53ba09a9ae5c250e1ab9c42ba9edccc476263", [:mix], []}, "mime": {:hex, :mime, "1.0.1", "05c393850524767d13a53627df71beeebb016205eb43bfbd92d14d24ec7a1b51", [:mix], []}, @@ -14,6 +15,7 @@ "nerves_toolchain_arm_unknown_linux_gnueabihf": {:hex, :nerves_toolchain_arm_unknown_linux_gnueabihf, "0.9.0", "5a1bca8c46776ad24c358ab58800ed470f91a3e294ac6eb8ffda0041954781e1", [:mix], [{:nerves, "~> 0.4.0", [hex: :nerves, optional: false]}, {:nerves_toolchain_ctng, "~> 0.8.0", [hex: :nerves_toolchain_ctng, optional: false]}]}, "nerves_toolchain_ctng": {:hex, :nerves_toolchain_ctng, "0.8.0", "6dff7ed51e1711c5f4da3d559bc528a8265e3dd950dda95f4d6832aed9dbe320", [:mix], []}, "nerves_wpa_supplicant": {:hex, :nerves_wpa_supplicant, "0.2.3", "2666b21bf0868f0d3b127930c3bacf59b178a0d015d308ae3985dcb7c1595870", [:make, :mix], [{:elixir_make, "~> 0.3", [hex: :elixir_make, optional: false]}]}, + "oauther": {:hex, :oauther, "1.1.0", "c9a56e200507ce64e069f5273143db0cddd7904cd5d1fe46920388a48f22441b", [:mix], []}, "phoenix": {:hex, :phoenix, "1.2.1", "6dc592249ab73c67575769765b66ad164ad25d83defa3492dc6ae269bd2a68ab", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, optional: true]}, {:phoenix_pubsub, "~> 1.0", [hex: :phoenix_pubsub, optional: false]}, {:plug, "~> 1.1", [hex: :plug, optional: false]}, {:poison, "~> 1.5 or ~> 2.0", [hex: :poison, optional: false]}]}, "phoenix_html": {:hex, :phoenix_html, "2.9.3", "1b5a2122cbf743aa242f54dced8a4f1cc778b8bd304f4b4c0043a6250c58e258", [:mix], [{:plug, "~> 1.0", [hex: :plug, optional: false]}]}, "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.0.8", "4333f9c74190f485a74866beff2f9304f069d53f047f5fbb0fb8d1ee4c495f73", [:mix], [{:fs, "~> 0.9.1", [hex: :fs, optional: false]}, {:phoenix, "~> 1.0 or ~> 1.2-rc", [hex: :phoenix, optional: false]}]}, From 966b95631a9ff94dad7ebf77d4ac15a5390aca37 Mon Sep 17 00:00:00 2001 From: Chris Rees Date: Wed, 22 Feb 2017 21:17:27 -0500 Subject: [PATCH 02/11] Push color to Neopixel --- apps/zapdos/lib/zapdos.ex | 8 +++++++- apps/zapdos/lib/zapdos/pluck.ex | 25 ------------------------- apps/zapdos/mix.exs | 1 + apps/zeus/lib/zeus.ex | 3 --- 4 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 apps/zapdos/lib/zapdos/pluck.ex diff --git a/apps/zapdos/lib/zapdos.ex b/apps/zapdos/lib/zapdos.ex index 5d96d2b..ec731ae 100644 --- a/apps/zapdos/lib/zapdos.ex +++ b/apps/zapdos/lib/zapdos.ex @@ -8,8 +8,14 @@ defmodule Zapdos do def get_tweets(query) do ExTwitter.stream_filter(track: query) |> Stream.map(fn(tweet) -> tweet.text end) - |> Stream.map(fn(text) -> ColorParsing.get_color(text) |> ColorParsing.hex_to_number |> IO.puts end) + |> Stream.map(&(update_color(&1))) |> Enum.to_list end + defp update_color(text) do + ColorParsing.get_color(text) + |> ColorParsing.parse_rgb_hex + |> Lightning.Control.change_color(150) + end + end diff --git a/apps/zapdos/lib/zapdos/pluck.ex b/apps/zapdos/lib/zapdos/pluck.ex deleted file mode 100644 index babf6df..0000000 --- a/apps/zapdos/lib/zapdos/pluck.ex +++ /dev/null @@ -1,25 +0,0 @@ -defmodule Zapdos.Pluck do - use GenServer - - def start_link do - GenServer.start_link(__MODULE__, %{}) - end - - def init(state) do - schedule_work() # Schedule work to be performed at some point - {:ok, state} - end - - def handle_info(:work, state) do - # Do the work you desire here - Zapdos.get_tweets("#cmm_storm", 1) - |> IO.inspect - - schedule_work() # Reschedule once more - {:noreply, state} - end - - defp schedule_work() do - Process.send_after(self(), :work, 15 * 1000) - end -end diff --git a/apps/zapdos/mix.exs b/apps/zapdos/mix.exs index be3aec0..5808870 100644 --- a/apps/zapdos/mix.exs +++ b/apps/zapdos/mix.exs @@ -35,6 +35,7 @@ defmodule Zapdos.Mixfile do defp deps do [ {:extwitter, "~> 0.8"}, + {:lightning, in_umbrella: true} ] end end diff --git a/apps/zeus/lib/zeus.ex b/apps/zeus/lib/zeus.ex index 01f4242..770a835 100644 --- a/apps/zeus/lib/zeus.ex +++ b/apps/zeus/lib/zeus.ex @@ -18,9 +18,6 @@ defmodule Zeus do # for other strategies and supported options opts = [strategy: :one_for_one, name: Zeus.Supervisor] Supervisor.start_link(children, opts) - - :timer.apply_interval(:timer.seconds(15), Zapdos, :get_tweet("#cmm_storm", 1)) - |> IO.puts end # Tell Phoenix to update the endpoint configuration From 579918881ae7e0d58a1fcf02ccd748ca2265b8e4 Mon Sep 17 00:00:00 2001 From: Joel Byler Date: Tue, 28 Feb 2017 16:48:08 -0500 Subject: [PATCH 03/11] Move color parsing module to lightning app --- .../lib/lightning}/color_parsing.ex | 3 +-- .../lib/lightning/neopixel_standin.ex | 1 + .../test/color_parsing_test.exs | 19 ++++++++++--------- apps/the_eye/mix.exs | 2 +- apps/zapdos/lib/zapdos.ex | 2 +- apps/zeus/lib/zeus/color_parsing.ex | 3 --- apps/zeus/web/controllers/page_controller.ex | 2 +- 7 files changed, 15 insertions(+), 17 deletions(-) rename apps/{zapdos/lib/zapdos => lightning/lib/lightning}/color_parsing.ex (92%) rename apps/{zeus => lightning}/test/color_parsing_test.exs (62%) delete mode 100644 apps/zeus/lib/zeus/color_parsing.ex diff --git a/apps/zapdos/lib/zapdos/color_parsing.ex b/apps/lightning/lib/lightning/color_parsing.ex similarity index 92% rename from apps/zapdos/lib/zapdos/color_parsing.ex rename to apps/lightning/lib/lightning/color_parsing.ex index bfa30ad..a4a2820 100644 --- a/apps/zapdos/lib/zapdos/color_parsing.ex +++ b/apps/lightning/lib/lightning/color_parsing.ex @@ -1,4 +1,4 @@ -defmodule Zapdos.ColorParsing do +defmodule Lightning.ColorParsing do def get_color("Color: #" <> <> <> _), do: raw_hex def get_color(_), do: "FFFFFF" @@ -12,4 +12,3 @@ defmodule Zapdos.ColorParsing do hex_value |> String.upcase |> Base.decode16! |> :binary.decode_unsigned end end - diff --git a/apps/lightning/lib/lightning/neopixel_standin.ex b/apps/lightning/lib/lightning/neopixel_standin.ex index d45d1f0..8ce0a50 100644 --- a/apps/lightning/lib/lightning/neopixel_standin.ex +++ b/apps/lightning/lib/lightning/neopixel_standin.ex @@ -1,5 +1,6 @@ defmodule Lightning.NeopixelStandin do def render(channel, {brightness, color_array}) do IO.puts("Rendering #{inspect(color_array)} at brightness #{inspect(brightness)} to channel #{inspect(channel)}") + {:ok, ""} end end diff --git a/apps/zeus/test/color_parsing_test.exs b/apps/lightning/test/color_parsing_test.exs similarity index 62% rename from apps/zeus/test/color_parsing_test.exs rename to apps/lightning/test/color_parsing_test.exs index e272511..59abdbf 100644 --- a/apps/zeus/test/color_parsing_test.exs +++ b/apps/lightning/test/color_parsing_test.exs @@ -1,44 +1,45 @@ defmodule ColorParsingTest do use ExUnit.Case - doctest Zeus.ColorParsing + doctest Lightning.ColorParsing describe "parse_rgb_hex" do test "parses out three values" do assert "#000000" - |> Zeus.ColorParsing.parse_rgb_hex + |> Lightning.ColorParsing.parse_rgb_hex + |> Tuple.to_list |> Enum.count == 3 end test "converts hex numbers to integers" do assert "#000000" - |> Zeus.ColorParsing.parse_rgb_hex - == [0, 0, 0] + |> Lightning.ColorParsing.parse_rgb_hex + == {0, 0, 0} end test "converts other hex numbers" do assert "#ffaa11" - |> Zeus.ColorParsing.parse_rgb_hex - == [255, 170, 17] + |> Lightning.ColorParsing.parse_rgb_hex + == {255, 170, 17} end end describe "hex_to_number" do test "Converts a small hex number" do assert "00" - |> Zeus.ColorParsing.hex_to_number + |> Lightning.ColorParsing.hex_to_number == 0 end test "Converts a large hex number" do assert "FF" - |> Zeus.ColorParsing.hex_to_number + |> Lightning.ColorParsing.hex_to_number == 255 end test "is able to work with lower case numbers" do assert "aa" - |> Zeus.ColorParsing.hex_to_number + |> Lightning.ColorParsing.hex_to_number == 170 end end diff --git a/apps/the_eye/mix.exs b/apps/the_eye/mix.exs index 11fb9ba..315d13f 100644 --- a/apps/the_eye/mix.exs +++ b/apps/the_eye/mix.exs @@ -45,7 +45,7 @@ defmodule TheEye.Mixfile do def aliases do ["deps.precompile": ["nerves.precompile", "deps.precompile"], "deps.loadpaths": ["deps.loadpaths", "nerves.loadpaths"], - "burn": ["compile", "firmware", "firmware.burn"]] + "burn": ["clean", "compile", "firmware", "firmware.burn"]] end end diff --git a/apps/zapdos/lib/zapdos.ex b/apps/zapdos/lib/zapdos.ex index ec731ae..860db9b 100644 --- a/apps/zapdos/lib/zapdos.ex +++ b/apps/zapdos/lib/zapdos.ex @@ -1,5 +1,5 @@ defmodule Zapdos do - alias Zapdos.ColorParsing + alias Lightning.ColorParsing @moduledoc """ Documentation for Zapdos. diff --git a/apps/zeus/lib/zeus/color_parsing.ex b/apps/zeus/lib/zeus/color_parsing.ex deleted file mode 100644 index 91abd4b..0000000 --- a/apps/zeus/lib/zeus/color_parsing.ex +++ /dev/null @@ -1,3 +0,0 @@ -defmodule Zeus.ColorParsing do - -end diff --git a/apps/zeus/web/controllers/page_controller.ex b/apps/zeus/web/controllers/page_controller.ex index 01ecd53..669c337 100644 --- a/apps/zeus/web/controllers/page_controller.ex +++ b/apps/zeus/web/controllers/page_controller.ex @@ -1,6 +1,6 @@ defmodule Zeus.PageController do use Zeus.Web, :controller - alias Zeus.ColorParsing + alias Lightning.ColorParsing def index(conn, _params) do render conn, "index.html", color: nil, brightness: nil From bac4af8688b9dfe31b81f46dc6656bd15dde0455 Mon Sep 17 00:00:00 2001 From: Chris Rees Date: Tue, 28 Feb 2017 13:21:38 -0500 Subject: [PATCH 04/11] Add Zapdos dependency to The Eye --- apps/the_eye/mix.exs | 3 ++- apps/zeus/mix.exs | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/the_eye/mix.exs b/apps/the_eye/mix.exs index 315d13f..0537fe7 100644 --- a/apps/the_eye/mix.exs +++ b/apps/the_eye/mix.exs @@ -34,7 +34,8 @@ defmodule TheEye.Mixfile do {:nerves_interim_wifi, "~> 0.1.0"}, {:nerves_neopixel, "~> 0.3.0"}, {:lightning, in_umbrella: true}, - {:zeus, in_umbrella: true}, + {:zapdos, in_umbrella: true}, + {:zeus, in_umbrella: true} ] end diff --git a/apps/zeus/mix.exs b/apps/zeus/mix.exs index 2fa5345..600e276 100644 --- a/apps/zeus/mix.exs +++ b/apps/zeus/mix.exs @@ -39,8 +39,7 @@ defmodule Zeus.Mixfile do {:phoenix_live_reload, "~> 1.0", only: :dev}, {:gettext, "~> 0.11"}, {:cowboy, "~> 1.0"}, - {:lightning, in_umbrella: true}, - {:zapdos, in_umbrella: true}] + {:lightning, in_umbrella: true}] end def aliases do From ed369d4b8779cc1b7db5d551fd7869023d6fc6d7 Mon Sep 17 00:00:00 2001 From: Chris Rees Date: Tue, 28 Feb 2017 16:48:51 -0500 Subject: [PATCH 05/11] Start Zapdos in The Eye --- apps/the_eye/lib/the_eye.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/the_eye/lib/the_eye.ex b/apps/the_eye/lib/the_eye.ex index 2dabee0..6018802 100644 --- a/apps/the_eye/lib/the_eye.ex +++ b/apps/the_eye/lib/the_eye.ex @@ -13,6 +13,7 @@ defmodule TheEye do children = [ worker(Task, [fn -> init_kernel_modules() end], restart: :transient, id: Nerves.Init.KernelModules), worker(Task, [fn -> init_network() end], restart: :transient, id: Nerves.Init.Network), + worker(Task, [fn -> init_zapdos() end], restart: :transient), worker(Nerves.Neopixel, [neopixel_cfg, nil]), ] @@ -29,4 +30,8 @@ defmodule TheEye do def init_network() do Nerves.InterimWiFi.setup(@interface, @wifi_cfg) end + + def init_zapdos() do + spawn(fn -> Zapdos.get_tweets('#cmm_storm') end) + end end From aa3873a82f1bb5a63e61f77d1ccc11f15a13ce16 Mon Sep 17 00:00:00 2001 From: Chris Rees Date: Tue, 28 Feb 2017 16:58:34 -0500 Subject: [PATCH 06/11] Add logging to Zapdos startup --- apps/the_eye/lib/the_eye.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/the_eye/lib/the_eye.ex b/apps/the_eye/lib/the_eye.ex index 6018802..85f9879 100644 --- a/apps/the_eye/lib/the_eye.ex +++ b/apps/the_eye/lib/the_eye.ex @@ -32,6 +32,8 @@ defmodule TheEye do end def init_zapdos() do - spawn(fn -> Zapdos.get_tweets('#cmm_storm') end) + IO.puts "Starting Zapdos" + pid = spawn(fn -> Zapdos.get_tweets('#cmm_storm') end) + IO.puts "Zapdos started: #{pid}" end end From 8bf1ff8db0485751f6d311b7eeb4ba500e467625 Mon Sep 17 00:00:00 2001 From: Chris Rees Date: Tue, 28 Feb 2017 17:30:52 -0500 Subject: [PATCH 07/11] Move Zapdos into Zeus temporarily --- apps/the_eye/lib/the_eye.ex | 6 ------ apps/zeus/lib/zeus.ex | 1 + apps/zeus/lib/zeus/zapdos.ex | 22 ++++++++++++++++++++++ apps/zeus/mix.exs | 5 +++-- 4 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 apps/zeus/lib/zeus/zapdos.ex diff --git a/apps/the_eye/lib/the_eye.ex b/apps/the_eye/lib/the_eye.ex index 85f9879..59133e9 100644 --- a/apps/the_eye/lib/the_eye.ex +++ b/apps/the_eye/lib/the_eye.ex @@ -13,7 +13,6 @@ defmodule TheEye do children = [ worker(Task, [fn -> init_kernel_modules() end], restart: :transient, id: Nerves.Init.KernelModules), worker(Task, [fn -> init_network() end], restart: :transient, id: Nerves.Init.Network), - worker(Task, [fn -> init_zapdos() end], restart: :transient), worker(Nerves.Neopixel, [neopixel_cfg, nil]), ] @@ -31,9 +30,4 @@ defmodule TheEye do Nerves.InterimWiFi.setup(@interface, @wifi_cfg) end - def init_zapdos() do - IO.puts "Starting Zapdos" - pid = spawn(fn -> Zapdos.get_tweets('#cmm_storm') end) - IO.puts "Zapdos started: #{pid}" - end end diff --git a/apps/zeus/lib/zeus.ex b/apps/zeus/lib/zeus.ex index 770a835..e254e63 100644 --- a/apps/zeus/lib/zeus.ex +++ b/apps/zeus/lib/zeus.ex @@ -10,6 +10,7 @@ defmodule Zeus do children = [ # Start the endpoint when the application starts supervisor(Zeus.Endpoint, []), + worker(Task, [fn -> Zapdos.get_tweets('#cmm_storm') end], restart: :transient), # Start your own worker by calling: Zeus.Worker.start_link(arg1, arg2, arg3) # worker(Zeus.Worker, [arg1, arg2, arg3]), ] diff --git a/apps/zeus/lib/zeus/zapdos.ex b/apps/zeus/lib/zeus/zapdos.ex new file mode 100644 index 0000000..a954c78 --- /dev/null +++ b/apps/zeus/lib/zeus/zapdos.ex @@ -0,0 +1,22 @@ +defmodule Zapdos do + alias Lightning.ColorParsing + + @moduledoc """ + Documentation for Zapdos. + """ + + def get_tweets(query) do + ExTwitter.stream_filter(track: query) + |> Stream.map(fn(tweet) -> tweet.text end) + |> Stream.map(&(update_color(&1))) + |> Enum.to_list + end + + defp update_color(text) do + ColorParsing.get_color(text) + |> ColorParsing.parse_rgb_hex + |> Lightning.Control.change_color(150) + end + +end + diff --git a/apps/zeus/mix.exs b/apps/zeus/mix.exs index 600e276..048df9a 100644 --- a/apps/zeus/mix.exs +++ b/apps/zeus/mix.exs @@ -22,7 +22,7 @@ defmodule Zeus.Mixfile do # Type `mix help compile.app` for more information. def application do [mod: {Zeus, []}, - applications: [:phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :logger, :gettext]] + applications: [:phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :logger, :gettext, :extwitter]] end # Specifies which paths to compile per environment. @@ -39,7 +39,8 @@ defmodule Zeus.Mixfile do {:phoenix_live_reload, "~> 1.0", only: :dev}, {:gettext, "~> 0.11"}, {:cowboy, "~> 1.0"}, - {:lightning, in_umbrella: true}] + {:lightning, in_umbrella: true}, + {:extwitter, "~> 0.8"}] end def aliases do From 4a56fce310ce962a518ca099453c350f7ddec494 Mon Sep 17 00:00:00 2001 From: Chris Rees Date: Thu, 2 Mar 2017 09:55:58 -0500 Subject: [PATCH 08/11] More starting Zapdos from Zeus --- apps/zeus/lib/zeus.ex | 2 +- apps/zeus/lib/zeus/zapdos.ex | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/zeus/lib/zeus.ex b/apps/zeus/lib/zeus.ex index e254e63..2d86975 100644 --- a/apps/zeus/lib/zeus.ex +++ b/apps/zeus/lib/zeus.ex @@ -10,7 +10,7 @@ defmodule Zeus do children = [ # Start the endpoint when the application starts supervisor(Zeus.Endpoint, []), - worker(Task, [fn -> Zapdos.get_tweets('#cmm_storm') end], restart: :transient), + worker(Task, [fn -> IO.puts("Starting Zapdos"); Zapdos.get_tweets('#cmm_storm') end], restart: :transient), # Start your own worker by calling: Zeus.Worker.start_link(arg1, arg2, arg3) # worker(Zeus.Worker, [arg1, arg2, arg3]), ] diff --git a/apps/zeus/lib/zeus/zapdos.ex b/apps/zeus/lib/zeus/zapdos.ex index a954c78..fc5f2cf 100644 --- a/apps/zeus/lib/zeus/zapdos.ex +++ b/apps/zeus/lib/zeus/zapdos.ex @@ -6,9 +6,11 @@ defmodule Zapdos do """ def get_tweets(query) do + IO.puts("Looking for tweets with '#{query}'") ExTwitter.stream_filter(track: query) |> Stream.map(fn(tweet) -> tweet.text end) - |> Stream.map(&(update_color(&1))) + |> Stream.map(fn(x) -> IO.puts "#{x}\n---------------\n" end) + # |> Stream.map(&(update_color(&1))) |> Enum.to_list end From 79801ce2808b2817d9a0bed5ae824f74032e5441 Mon Sep 17 00:00:00 2001 From: Joel Byler Date: Thu, 2 Mar 2017 15:04:52 -0500 Subject: [PATCH 09/11] Rearranging Usages of Zapdos and debug puts --- apps/the_eye/lib/the_eye.ex | 1 + apps/the_eye/mix.exs | 5 +++-- apps/zapdos/lib/zapdos.ex | 3 +++ apps/zapdos/mix.exs | 4 ++-- apps/zeus/lib/zeus.ex | 1 - apps/zeus/lib/zeus/zapdos.ex | 24 ------------------------ 6 files changed, 9 insertions(+), 29 deletions(-) delete mode 100644 apps/zeus/lib/zeus/zapdos.ex diff --git a/apps/the_eye/lib/the_eye.ex b/apps/the_eye/lib/the_eye.ex index 59133e9..483f205 100644 --- a/apps/the_eye/lib/the_eye.ex +++ b/apps/the_eye/lib/the_eye.ex @@ -14,6 +14,7 @@ defmodule TheEye do worker(Task, [fn -> init_kernel_modules() end], restart: :transient, id: Nerves.Init.KernelModules), worker(Task, [fn -> init_network() end], restart: :transient, id: Nerves.Init.Network), worker(Nerves.Neopixel, [neopixel_cfg, nil]), + worker(Task, [fn -> IO.puts("Starting Zapdos"); Zapdos.get_tweets('#cmm_storm') end], restart: :transient), ] # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html diff --git a/apps/the_eye/mix.exs b/apps/the_eye/mix.exs index 0537fe7..a9ded2a 100644 --- a/apps/the_eye/mix.exs +++ b/apps/the_eye/mix.exs @@ -25,7 +25,7 @@ defmodule TheEye.Mixfile do # Type `mix help compile.app` for more information. def application do [mod: {TheEye, []}, - applications: [:logger, :nerves_interim_wifi, :nerves_neopixel, :lightning, :zeus]] + applications: [:logger, :nerves_interim_wifi, :nerves_neopixel, :lightning, :zeus, :zapdos]] end def deps do @@ -34,8 +34,9 @@ defmodule TheEye.Mixfile do {:nerves_interim_wifi, "~> 0.1.0"}, {:nerves_neopixel, "~> 0.3.0"}, {:lightning, in_umbrella: true}, + {:oauther, "~> 1.1"}, {:zapdos, in_umbrella: true}, - {:zeus, in_umbrella: true} + {:zeus, in_umbrella: true}, ] end diff --git a/apps/zapdos/lib/zapdos.ex b/apps/zapdos/lib/zapdos.ex index 860db9b..99a06cc 100644 --- a/apps/zapdos/lib/zapdos.ex +++ b/apps/zapdos/lib/zapdos.ex @@ -6,6 +6,8 @@ defmodule Zapdos do """ def get_tweets(query) do + # Process.sleep(30000) + IO.puts "get_tweets: #{query}" ExTwitter.stream_filter(track: query) |> Stream.map(fn(tweet) -> tweet.text end) |> Stream.map(&(update_color(&1))) @@ -13,6 +15,7 @@ defmodule Zapdos do end defp update_color(text) do + IO.puts "update_color: #{text}" ColorParsing.get_color(text) |> ColorParsing.parse_rgb_hex |> Lightning.Control.change_color(150) diff --git a/apps/zapdos/mix.exs b/apps/zapdos/mix.exs index 5808870..f65b402 100644 --- a/apps/zapdos/mix.exs +++ b/apps/zapdos/mix.exs @@ -19,7 +19,7 @@ defmodule Zapdos.Mixfile do # Type "mix help compile.app" for more information def application do # Specify extra applications you'll use from Erlang/Elixir - [extra_applications: [:logger], + [extra_applications: [:logger, :extwitter], mod: {Zapdos.Application, []}] end @@ -35,7 +35,7 @@ defmodule Zapdos.Mixfile do defp deps do [ {:extwitter, "~> 0.8"}, - {:lightning, in_umbrella: true} + {:lightning, in_umbrella: true} ] end end diff --git a/apps/zeus/lib/zeus.ex b/apps/zeus/lib/zeus.ex index 2d86975..770a835 100644 --- a/apps/zeus/lib/zeus.ex +++ b/apps/zeus/lib/zeus.ex @@ -10,7 +10,6 @@ defmodule Zeus do children = [ # Start the endpoint when the application starts supervisor(Zeus.Endpoint, []), - worker(Task, [fn -> IO.puts("Starting Zapdos"); Zapdos.get_tweets('#cmm_storm') end], restart: :transient), # Start your own worker by calling: Zeus.Worker.start_link(arg1, arg2, arg3) # worker(Zeus.Worker, [arg1, arg2, arg3]), ] diff --git a/apps/zeus/lib/zeus/zapdos.ex b/apps/zeus/lib/zeus/zapdos.ex deleted file mode 100644 index fc5f2cf..0000000 --- a/apps/zeus/lib/zeus/zapdos.ex +++ /dev/null @@ -1,24 +0,0 @@ -defmodule Zapdos do - alias Lightning.ColorParsing - - @moduledoc """ - Documentation for Zapdos. - """ - - def get_tweets(query) do - IO.puts("Looking for tweets with '#{query}'") - ExTwitter.stream_filter(track: query) - |> Stream.map(fn(tweet) -> tweet.text end) - |> Stream.map(fn(x) -> IO.puts "#{x}\n---------------\n" end) - # |> Stream.map(&(update_color(&1))) - |> Enum.to_list - end - - defp update_color(text) do - ColorParsing.get_color(text) - |> ColorParsing.parse_rgb_hex - |> Lightning.Control.change_color(150) - end - -end - From c3350928554c5699e92ef4f8c4ce75dc6a4d50c7 Mon Sep 17 00:00:00 2001 From: Chris Rees Date: Thu, 2 Mar 2017 16:17:07 -0500 Subject: [PATCH 10/11] Add oauther to list of apps --- apps/lightning/lib/lightning/control.ex | 4 ++-- apps/lightning/mix.exs | 2 +- apps/the_eye/mix.exs | 5 ++--- apps/zapdos/lib/zapdos.ex | 2 +- apps/zapdos/mix.exs | 2 +- apps/zeus/mix.exs | 7 +++---- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/apps/lightning/lib/lightning/control.ex b/apps/lightning/lib/lightning/control.ex index 6bc8591..29616aa 100644 --- a/apps/lightning/lib/lightning/control.ex +++ b/apps/lightning/lib/lightning/control.ex @@ -10,8 +10,8 @@ defmodule Lightning.Control do end def change_color(ch, color, brightness) do - IO.puts renderer - renderer.render(ch, {brightness, [color]}) + IO.puts renderer() + renderer().render(ch, {brightness, [color]}) end def renderer do diff --git a/apps/lightning/mix.exs b/apps/lightning/mix.exs index d290722..74c8852 100644 --- a/apps/lightning/mix.exs +++ b/apps/lightning/mix.exs @@ -11,7 +11,7 @@ defmodule Lightning.Mixfile do elixir: "~> 1.3", build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod, - deps: deps] + deps: deps()] end # Configuration for the OTP application diff --git a/apps/the_eye/mix.exs b/apps/the_eye/mix.exs index a9ded2a..58bf65b 100644 --- a/apps/the_eye/mix.exs +++ b/apps/the_eye/mix.exs @@ -25,7 +25,7 @@ defmodule TheEye.Mixfile do # Type `mix help compile.app` for more information. def application do [mod: {TheEye, []}, - applications: [:logger, :nerves_interim_wifi, :nerves_neopixel, :lightning, :zeus, :zapdos]] + applications: [:logger, :nerves_interim_wifi, :nerves_neopixel, :lightning, :zapdos, :zeus]] end def deps do @@ -34,9 +34,8 @@ defmodule TheEye.Mixfile do {:nerves_interim_wifi, "~> 0.1.0"}, {:nerves_neopixel, "~> 0.3.0"}, {:lightning, in_umbrella: true}, - {:oauther, "~> 1.1"}, {:zapdos, in_umbrella: true}, - {:zeus, in_umbrella: true}, + {:zeus, in_umbrella: true} ] end diff --git a/apps/zapdos/lib/zapdos.ex b/apps/zapdos/lib/zapdos.ex index 99a06cc..4c22099 100644 --- a/apps/zapdos/lib/zapdos.ex +++ b/apps/zapdos/lib/zapdos.ex @@ -6,7 +6,7 @@ defmodule Zapdos do """ def get_tweets(query) do - # Process.sleep(30000) + Process.sleep(10000) IO.puts "get_tweets: #{query}" ExTwitter.stream_filter(track: query) |> Stream.map(fn(tweet) -> tweet.text end) diff --git a/apps/zapdos/mix.exs b/apps/zapdos/mix.exs index f65b402..27b0e01 100644 --- a/apps/zapdos/mix.exs +++ b/apps/zapdos/mix.exs @@ -19,7 +19,7 @@ defmodule Zapdos.Mixfile do # Type "mix help compile.app" for more information def application do # Specify extra applications you'll use from Erlang/Elixir - [extra_applications: [:logger, :extwitter], + [applications: [:logger, :oauther, :extwitter], mod: {Zapdos.Application, []}] end diff --git a/apps/zeus/mix.exs b/apps/zeus/mix.exs index 048df9a..2afdce4 100644 --- a/apps/zeus/mix.exs +++ b/apps/zeus/mix.exs @@ -13,7 +13,7 @@ defmodule Zeus.Mixfile do compilers: [:phoenix, :gettext] ++ Mix.compilers, build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod, - aliases: aliases, + aliases: aliases(), deps: deps()] end @@ -22,7 +22,7 @@ defmodule Zeus.Mixfile do # Type `mix help compile.app` for more information. def application do [mod: {Zeus, []}, - applications: [:phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :logger, :gettext, :extwitter]] + applications: [:phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :logger, :gettext]] end # Specifies which paths to compile per environment. @@ -39,8 +39,7 @@ defmodule Zeus.Mixfile do {:phoenix_live_reload, "~> 1.0", only: :dev}, {:gettext, "~> 0.11"}, {:cowboy, "~> 1.0"}, - {:lightning, in_umbrella: true}, - {:extwitter, "~> 0.8"}] + {:lightning, in_umbrella: true}] end def aliases do From 469a518f18c2b2c505c613d742369ae9dededfca Mon Sep 17 00:00:00 2001 From: Joel Byler Date: Mon, 6 Mar 2017 16:43:45 -0500 Subject: [PATCH 11/11] WIP --- apps/lightning/lib/lightning/control.ex | 8 +++++--- apps/the_eye/lib/the_eye.ex | 24 +++++++++++++++++++++++- apps/the_eye/mix.exs | 5 +++-- apps/zapdos/config/config.exs | 7 +------ mix.lock | 1 + 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/apps/lightning/lib/lightning/control.ex b/apps/lightning/lib/lightning/control.ex index 29616aa..dd1de37 100644 --- a/apps/lightning/lib/lightning/control.ex +++ b/apps/lightning/lib/lightning/control.ex @@ -9,12 +9,14 @@ defmodule Lightning.Control do change_color(0, color, brightness) end - def change_color(ch, color, brightness) do + def change_color(channel, color, brightness) do IO.puts renderer() - renderer().render(ch, {brightness, [color]}) + IO.puts("Rendering #{inspect([color])} at brightness #{inspect(brightness)} to channel #{inspect(channel)}") + renderer().render(channel, {brightness, [color]}) end def renderer do - @renderer || Lightning.NeopixelStandin + # @renderer || Lightning.NeopixelStandin + Nerves.Neopixel end end diff --git a/apps/the_eye/lib/the_eye.ex b/apps/the_eye/lib/the_eye.ex index 483f205..2dd6461 100644 --- a/apps/the_eye/lib/the_eye.ex +++ b/apps/the_eye/lib/the_eye.ex @@ -1,5 +1,6 @@ defmodule TheEye do use Application + alias Lightning.ColorParsing @kernel_module "brcmfmac" @interface :wlan0 @@ -13,8 +14,9 @@ defmodule TheEye do children = [ worker(Task, [fn -> init_kernel_modules() end], restart: :transient, id: Nerves.Init.KernelModules), worker(Task, [fn -> init_network() end], restart: :transient, id: Nerves.Init.Network), + worker(Task, [fn -> init_ntpd() end], restart: :transient, id: Nerves.Init.Ntpd), worker(Nerves.Neopixel, [neopixel_cfg, nil]), - worker(Task, [fn -> IO.puts("Starting Zapdos"); Zapdos.get_tweets('#cmm_storm') end], restart: :transient), + worker(Task, [fn -> IO.puts("Starting Twitter Connection"); get_tweets('#cmm_storm') end], restart: :transient), ] # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html @@ -31,4 +33,24 @@ defmodule TheEye do Nerves.InterimWiFi.setup(@interface, @wifi_cfg) end + def get_tweets(query) do + Process.sleep(10000) + IO.puts "get_tweets: #{query}" + ExTwitter.stream_filter(track: query) + |> Stream.map(fn(tweet) -> tweet.text end) + |> Stream.map(&(update_color(&1))) + |> Enum.to_list + end + + defp update_color(text) do + IO.puts "update_color: #{text}" + ColorParsing.get_color(text) + |> ColorParsing.parse_rgb_hex + |> Lightning.Control.change_color(150) + end + + def init_ntpd do + Process.sleep(8000) + System.cmd("ntpd", ["-q", "-p", "pool.ntp.org"]) + end end diff --git a/apps/the_eye/mix.exs b/apps/the_eye/mix.exs index 58bf65b..abf8b5d 100644 --- a/apps/the_eye/mix.exs +++ b/apps/the_eye/mix.exs @@ -25,16 +25,17 @@ defmodule TheEye.Mixfile do # Type `mix help compile.app` for more information. def application do [mod: {TheEye, []}, - applications: [:logger, :nerves_interim_wifi, :nerves_neopixel, :lightning, :zapdos, :zeus]] + applications: [:logger, :nerves_interim_wifi, :nerves_ntp, :nerves_neopixel, :oauther, :extwitter, :lightning, :zeus]] end def deps do [ {:nerves, "~> 0.4.0"}, {:nerves_interim_wifi, "~> 0.1.0"}, + {:nerves_ntp, "~> 0.1.1"}, {:nerves_neopixel, "~> 0.3.0"}, + {:extwitter, "~> 0.8"}, {:lightning, in_umbrella: true}, - {:zapdos, in_umbrella: true}, {:zeus, in_umbrella: true} ] end diff --git a/apps/zapdos/config/config.exs b/apps/zapdos/config/config.exs index 7de8b7e..152aa8e 100644 --- a/apps/zapdos/config/config.exs +++ b/apps/zapdos/config/config.exs @@ -29,9 +29,4 @@ use Mix.Config # # import_config "#{Mix.env}.exs" -config :extwitter, :oauth, [ - consumer_key: "", - consumer_secret: "", - access_token: "", - access_token_secret: "" -] +config :lightning, renderer: Lightning.NeopixelStandin diff --git a/mix.lock b/mix.lock index 6f6f958..42351d6 100644 --- a/mix.lock +++ b/mix.lock @@ -10,6 +10,7 @@ "nerves_interim_wifi": {:hex, :nerves_interim_wifi, "0.1.1", "88c65ced1440e96b954189ccfc8a55cb4575cb64a8725907c3e8a9900adb2a70", [:make, :mix], [{:elixir_make, "~> 0.3", [hex: :elixir_make, optional: false]}, {:nerves_network_interface, "~> 0.3.1", [hex: :nerves_network_interface, optional: false]}, {:nerves_wpa_supplicant, "~> 0.2.2", [hex: :nerves_wpa_supplicant, optional: false]}]}, "nerves_neopixel": {:hex, :nerves_neopixel, "0.3.0", "afd9c906896f0b39a2bea61cf01afe304d550bc74c789a5e872d64df5e1ae559", [:make, :mix], [{:elixir_make, "~> 0.3.0", [hex: :elixir_make, optional: false]}]}, "nerves_network_interface": {:hex, :nerves_network_interface, "0.3.3", "0a49e00f9f0bdb482e94d8e9885cf0a250ae04cc18d248d83bc184b8813ddda2", [:make, :mix], [{:elixir_make, "~> 0.3", [hex: :elixir_make, optional: false]}]}, + "nerves_ntp": {:hex, :nerves_ntp, "0.1.1", "fa1a1f5c325d00fc3d940d8f5deea98964c84e617c7370325989d64accfa698a", [:mix], []}, "nerves_system_br": {:hex, :nerves_system_br, "0.9.4", "5096a9dfec49d4663ccb94c4a4fe45885303fbf31108f7e9400369bdec94b5e7", [:mix], []}, "nerves_system_rpi3": {:hex, :nerves_system_rpi3, "0.10.0", "dc5c05e1caf13027aaa57b4142d128513d9c29acc3284cc984a6770592ed4b34", [:mix], [{:nerves, "~> 0.4.0", [hex: :nerves, optional: false]}, {:nerves_system_br, "~> 0.9.2", [hex: :nerves_system_br, optional: false]}, {:nerves_toolchain_arm_unknown_linux_gnueabihf, "~> 0.9.0", [hex: :nerves_toolchain_arm_unknown_linux_gnueabihf, optional: false]}]}, "nerves_toolchain_arm_unknown_linux_gnueabihf": {:hex, :nerves_toolchain_arm_unknown_linux_gnueabihf, "0.9.0", "5a1bca8c46776ad24c358ab58800ed470f91a3e294ac6eb8ffda0041954781e1", [:mix], [{:nerves, "~> 0.4.0", [hex: :nerves, optional: false]}, {:nerves_toolchain_ctng, "~> 0.8.0", [hex: :nerves_toolchain_ctng, optional: false]}]},