|
|
@ -11,7 +11,7 @@ import ( |
|
|
|
func NewSceneMap(resolver device.Resolver) *SceneMap { |
|
|
|
return &SceneMap{ |
|
|
|
resolver: resolver, |
|
|
|
sceneMap: make(map[string]int64, 64), |
|
|
|
sceneMap: make(map[string]string, 64), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -19,10 +19,10 @@ type SceneMap struct { |
|
|
|
resolver device.Resolver |
|
|
|
|
|
|
|
mu sync.Mutex |
|
|
|
sceneMap map[string]int64 |
|
|
|
sceneMap map[string]string |
|
|
|
} |
|
|
|
|
|
|
|
func (s *SceneMap) SceneID(id string) *int64 { |
|
|
|
func (s *SceneMap) SceneID(id string) *string { |
|
|
|
s.mu.Lock() |
|
|
|
defer s.mu.Unlock() |
|
|
|
|
|
|
@ -48,7 +48,7 @@ func (s *SceneMap) HandleCommand(_ *lucifer3.EventBus, command lucifer3.Command) |
|
|
|
if len(matched) > 0 { |
|
|
|
s.mu.Lock() |
|
|
|
for _, ptr := range matched { |
|
|
|
s.sceneMap[ptr.ID] = command.SceneID |
|
|
|
s.sceneMap[ptr.ID] = command.SceneName |
|
|
|
} |
|
|
|
s.mu.Unlock() |
|
|
|
} |
|
|
|