make led states an array

This commit is contained in:
neri 2020-02-04 22:52:29 +01:00
parent 4ff50f961a
commit a91d6bc576
1 changed files with 4 additions and 4 deletions

View File

@ -62,12 +62,12 @@ func GetBestStateFromList(spaces []*Space) State {
return state
}
func (s *StateAggregator) GetLedStates() map[int]string {
states := make(map[int]string)
func (s *StateAggregator) GetLedStates() []string {
var states []string
s.mtx.RLock()
for i, spaceList := range s.ledList {
states[i] = ColorMap[GetBestStateFromList(spaceList)]
for _, spaceList := range s.ledList {
states = append(states, ColorMap[GetBestStateFromList(spaceList)])
}
s.mtx.RUnlock()