diff --git a/chipper/pkg/vars/config.go b/chipper/pkg/vars/config.go
index 47350869..40b60e6f 100644
--- a/chipper/pkg/vars/config.go
+++ b/chipper/pkg/vars/config.go
@@ -21,19 +21,21 @@ type apiConfig struct {
Unit string `json:"unit"`
} `json:"weather"`
Knowledge struct {
- Enable bool `json:"enable"`
- Provider string `json:"provider"`
- Key string `json:"key"`
- ID string `json:"id"`
- Model string `json:"model"`
- IntentGraph bool `json:"intentgraph"`
- RobotName string `json:"robotName"`
- OpenAIPrompt string `json:"openai_prompt"`
- OpenAIVoice string `json:"openai_voice"`
- OpenAIVoiceWithEnglish bool `json:"openai_voice_with_english"`
- SaveChat bool `json:"save_chat"`
- CommandsEnable bool `json:"commands_enable"`
- Endpoint string `json:"endpoint"`
+ Enable bool `json:"enable"`
+ Provider string `json:"provider"`
+ Key string `json:"key"`
+ ID string `json:"id"`
+ Model string `json:"model"`
+ IntentGraph bool `json:"intentgraph"`
+ RobotName string `json:"robotName"`
+ OpenAIPrompt string `json:"openai_prompt"`
+ OpenAIVoice string `json:"openai_voice"`
+ OpenAIVoiceWithEnglish bool `json:"openai_voice_with_english"`
+ SaveChat bool `json:"save_chat"`
+ CommandsEnable bool `json:"commands_enable"`
+ Endpoint string `json:"endpoint"`
+ TopP float32 `json:"top_p"`
+ Temperature float32 `json:"temp"`
} `json:"knowledge"`
STT struct {
Service string `json:"provider"`
diff --git a/chipper/pkg/wirepod/setup/ssh.go b/chipper/pkg/wirepod/setup/ssh.go
index 6c32cf87..cd40bdd5 100644
--- a/chipper/pkg/wirepod/setup/ssh.go
+++ b/chipper/pkg/wirepod/setup/ssh.go
@@ -156,9 +156,9 @@ func SetupBotViaSSH(ip string, key []byte) error {
}
}
} else {
- resp, _ := http.Get("https://github.com/kercre123/wire-pod/raw/main/vector-cloud/build/vic-cloud")
+ resp, err := http.Get("https://github.com/kercre123/wire-pod/raw/main/vector-cloud/build/vic-cloud")
if err != nil {
- return doErr(err, "transferring new vic-cloud")
+ return doErr(err, "transferring new vic-cloud (download)")
}
SetupSSHStatus = "Transferring new vic-cloud..."
scpClient, err = scp.NewClientBySSH(client)
@@ -228,7 +228,7 @@ func SSHSetup(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "error: must provide ssh key ("+err.Error()+")")
return
}
- keyBytes, _ := io.ReadAll(key)
+ keyBytes, err := io.ReadAll(key)
if len(keyBytes) < 5 {
fmt.Fprint(w, "error: must provide ssh key ("+err.Error()+")")
return
diff --git a/chipper/webroot/js/battery.js b/chipper/webroot/js/battery.js
index a28bdec5..6f79bffe 100644
--- a/chipper/webroot/js/battery.js
+++ b/chipper/webroot/js/battery.js
@@ -52,6 +52,9 @@ async function updateBatteryInfo(serial, i) {
// Do nothing
}
if (!batteryStatus) {
+ if (charging) {
+ charging.remove();
+ }
batteryLevel.className = "batteryLevel batteryUnknown";
vectorFace.style.backgroundImage = "url(/assets/wififace.gif)";
tooltip.innerHTML = `${serial}
??%
(Unable to connect)`;
@@ -77,6 +80,7 @@ async function updateBatteryInfo(serial, i) {
batteryStatus["battery_level"] = 0; // Set color to red
}
+
// Set the battery level based on the battery_level value and handle the rest in css
const batteryLevelClass = "batteryLevel battery" + batteryStatus["battery_level"];
if (batteryLevel.className !== batteryLevelClass) {
@@ -105,6 +109,8 @@ async function updateBatteryInfo(serial, i) {
chargeTimeRemaining.innerHTML = "";
}else {
chargeTimeRemaining.innerHTML = "Full";
+ // assume 100% if Full
+ batteryLevel.style.width = "100%";
vectorFace.style.backgroundImage = "url(/assets/face.gif)";
}
} else {