diff --git a/spaceAggregator.go b/spaceAggregator.go index 397b3ee..3e653ad 100644 --- a/spaceAggregator.go +++ b/spaceAggregator.go @@ -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()