func stateCmd(id string) { connection := config.ReadConfig() setState := &lights.SetStateValues{ On: on, Alert: alert, Bri: bri, Hue: hue, Sat: sat, XY: xy, Ct: ct, Effect: effect, TransitionTime: transitionTime, BriInc: briInc, SatInc: satInc, HueInc: hueInc, CtInc: ctInc, XYInc: xyInc, } result, errHUE, err := lights.SetState(connection, id, setState) internal.CheckErrors(err, errHUE) jsonStr, err := json.MarshalIndent(result, "", " ") internal.Check(err) internal.FormatOutputDef(jsonStr) }
func getCmd(id string) { connection := config.ReadConfig() result, errHUE, err := rules.GetRule(connection, id) internal.CheckErrors(err, errHUE) jsonStr, err := json.MarshalIndent(result, "", " ") internal.Check(err) internal.FormatOutputDef(jsonStr) }
func allCmd() { connection := config.ReadConfig() result, errHUE, err := groups.GetAllGroups(connection) internal.CheckErrors(err, errHUE) jsonStr, err := json.MarshalIndent(result, "", " ") internal.Check(err) internal.FormatOutputDef(jsonStr) }