spotify-now
Version:
spotify, rgb and bob.
11 lines (8 loc) • 388 B
text/typescript
import { Led } from "johnny-five";
import { refreshTokenWhenExpire } from "../spotifyApi";
import { getColor } from "./getColor";
export async function handleColor(led: Led.RGB) {
const color = await refreshTokenWhenExpire(getColor);
// the type definition on this method is wrong. (should accept type of number[])
led.color((color as unknown as string) || "000000");
}