Drop BridgeId from state and support multiple bridges
This commit is contained in:
parent
6450f76d78
commit
b3985f8b9b
@ -1,4 +1,4 @@
|
||||
package main
|
||||
var BridgeId = ""
|
||||
|
||||
var clientSecret = ""
|
||||
var clientId = ""
|
||||
|
@ -33,7 +33,6 @@ func fetchData(tokenFile string) *State {
|
||||
|
||||
var state = &State{
|
||||
Api: client,
|
||||
BridgeId: BridgeId,
|
||||
Auth: httptransport.BearerToken(token.AccessToken),
|
||||
NameForRoom: make(map[string]string),
|
||||
RoomForName: make(map[string]string),
|
||||
|
2
move.go
2
move.go
@ -15,7 +15,7 @@ func Move(state *State, shutters []string, position int64) {
|
||||
var updates []*models.ModulePercentage
|
||||
for _, x := range shutters {
|
||||
m := &models.ModulePercentage{
|
||||
Bridge: state.BridgeId,
|
||||
Bridge: state.ModuleStatus[state.ModuleForName[x]].Bridge,
|
||||
ID: state.ModuleForName[x],
|
||||
TargetPosition: position,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user