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