Drop BridgeId from state and support multiple bridges

This commit is contained in:
Florian Eitel 2019-08-11 21:55:21 +02:00
parent 6450f76d78
commit b3985f8b9b
Signed by: flo
GPG Key ID: 9987EAFEF6F686BB
3 changed files with 2 additions and 3 deletions

View File

@ -1,4 +1,4 @@
package main
var BridgeId = ""
var clientSecret = ""
var clientId = ""

View File

@ -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),

View File

@ -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,
}