forked from mamu/spacepanel_aggregator
make led states an array
This commit is contained in:
parent
4ff50f961a
commit
a91d6bc576
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue