WKHarmon / led-sectional

MIT License
35 stars 20 forks source link

How to use White for no data vs Black #6

Closed jasonfish closed 5 years ago

jasonfish commented 5 years ago

I'd like to have stations display white (or any other color, really) when there's no valid weather report, rather than turn off. Winds and lightning are both false.

I've changed the following lines: fill_solid(leds, NUM_AIRPORTS, CRGB::White); and } else color = CRGB::White;

I've also tried Aqua, just for giggles. When changing a known-good station name to an invalid string, like KSEAo, the LED just shuts off.

Tips?

WKHarmon commented 5 years ago

I suspect that the problem is the FastLED.clear(); on line 347. Try adding fill_solid(leds, NUM_AIRPORTS, CRGB::White); immediately after that. My guess is that the earlier fill_solid actually doesn't do anything because of the clear later. Unfortunately, I'm not somewhere that I can test it readily at the moment.

The } else color = CRGB::White; on line 482 will only trigger if there is actually a METAR returned by the API for that airport, but there was no flight category returned, so it probably won't happen much.

jasonfish commented 5 years ago

That did it. Thanks!