minor fixes, pre-implemented battery firmware upgrade (needs the binary)

This commit is contained in:
Kim 2023-05-25 12:55:23 +02:00
parent c969b72a82
commit ec4d76f8fd
3 changed files with 7 additions and 5 deletions

View File

@ -126,7 +126,7 @@ public class Controller : ControllerBase
var data = new
{
inst = installsForHtml,
serverIp = "10.2.0.1",
serverIp = "10.2.0.1", //TODO MAKE ME DYNAMIC
firmwareVersion = FirmwareVersion
};
@ -158,7 +158,7 @@ public class Controller : ControllerBase
return new AcceptedResult();
}
private void SendNewBatteryFirmware(String installationIp)
private static void SendNewBatteryFirmware(String installationIp)
{
Cli.Wrap("scp")
.WithArguments($@"{FirmwareVersion}.bin")

View File

@ -90,6 +90,9 @@ public static partial class Db
await NumberOfBatteries(ip[0], ip[1]),
await BatteryFirmwareVersion(ip[0], ip[1]));
if (ip[0] != "Unknown")
await UpdateInstallationName(installation, ip[0]);
if (GetInstallationByIdentifier(installation.Identifier) == null)
{
Create(updatedInstallation);
@ -165,10 +168,9 @@ public static partial class Db
var ip = await VpnInfo.LookUpIp(i.Identifier, details.MachineSerial()) ?? "Unknown";
if (ip != "Unknown")
await UpdateInstallationName(i, ip);
var installationDetails = new InstallationDetails(ip, details);
return new InstallationDetails(ip, details);
return installationDetails;
}
catch (Exception e)
{

Binary file not shown.