[2/2] Improve led availability checking and caching.

First part frameworks/base.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>