fix: update GoTomato model field names
adjust field names due to breaking changes in GoTomato v0.0.4
This commit is contained in:
parent
2430e22756
commit
0f8fde3143
6 changed files with 16 additions and 18 deletions
|
@ -36,7 +36,7 @@ func keyhandler(conn *ws.Conn, config ChronoTomato.Config, message *GoTomato.Ser
|
|||
case "s":
|
||||
websocket.SendCmd(conn, config.Password, "stop")
|
||||
case "r":
|
||||
if config.PomodoroConfig != (GoTomato.GoTomatoPomodoroConfig{}) {
|
||||
if config.PomodoroConfig != (GoTomato.PomodoroConfig{}) {
|
||||
websocket.Send_updateSettings(conn, config.Password, config.PomodoroConfig)
|
||||
}
|
||||
case "q":
|
||||
|
|
|
@ -16,17 +16,17 @@ func desktopNotifications(pomodoro GoTomato.ServerMessage) {
|
|||
|
||||
mode := pomodoro.Mode
|
||||
session := pomodoro.Session
|
||||
sessions := pomodoro.PomodoroSettings.Sessions
|
||||
sessions := pomodoro.Settings.Sessions
|
||||
|
||||
switch mode {
|
||||
case "Work":
|
||||
duration = pomodoro.PomodoroSettings.Work
|
||||
duration = pomodoro.Settings.Work
|
||||
notification = fmt.Sprintf("Session %d/%d: %s %0.f minutes", session, sessions, mode, float32(duration)/60)
|
||||
case "ShortBreak":
|
||||
duration = pomodoro.PomodoroSettings.ShortBreak
|
||||
duration = pomodoro.Settings.ShortBreak
|
||||
notification = fmt.Sprintf("Session %d/%d: Take a %0.f minute break", session, sessions, float32(duration)/60)
|
||||
case "LongBreak":
|
||||
duration = pomodoro.PomodoroSettings.LongBreak
|
||||
duration = pomodoro.Settings.LongBreak
|
||||
notification = fmt.Sprintf("Long Break: Take a %0.f minute break", float32(duration)/60)
|
||||
case "End":
|
||||
duration = 0
|
||||
|
|
|
@ -18,9 +18,9 @@ func terminalOutput(pomodoro GoTomato.ServerMessage) {
|
|||
|
||||
// header
|
||||
color.Blue("Work: %d ◊ Break: %d ◊ Longbreak: %d\n\n",
|
||||
pomodoro.PomodoroSettings.Work/60,
|
||||
pomodoro.PomodoroSettings.ShortBreak/60,
|
||||
pomodoro.PomodoroSettings.LongBreak/60,
|
||||
pomodoro.Settings.Work/60,
|
||||
pomodoro.Settings.ShortBreak/60,
|
||||
pomodoro.Settings.LongBreak/60,
|
||||
)
|
||||
|
||||
//body
|
||||
|
@ -41,7 +41,7 @@ func terminalOutput(pomodoro GoTomato.ServerMessage) {
|
|||
|
||||
fmt.Printf("Session: %d/%d\n",
|
||||
pomodoro.Session,
|
||||
pomodoro.PomodoroSettings.Sessions,
|
||||
pomodoro.Settings.Sessions,
|
||||
)
|
||||
fmt.Printf("%s %s\n", modePrefix, pomodoro.Mode)
|
||||
fmt.Printf(timerOutput)
|
||||
|
|
|
@ -31,11 +31,11 @@ func SendCmd(conn *websocket.Conn, pwd string, cmd string) {
|
|||
sendClientCommand(conn, message)
|
||||
}
|
||||
|
||||
func Send_updateSettings(conn *websocket.Conn, pwd string, settings GoTomato.GoTomatoPomodoroConfig) {
|
||||
func Send_updateSettings(conn *websocket.Conn, pwd string, settings GoTomato.PomodoroConfig) {
|
||||
message := GoTomato.ClientCommand{
|
||||
Command: "updateSettings",
|
||||
Password: pwd,
|
||||
PomodoroSettings: settings,
|
||||
Command: "updateSettings",
|
||||
Password: pwd,
|
||||
Settings: settings,
|
||||
}
|
||||
|
||||
sendClientCommand(conn, message)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue