minor fixes, pre-implemented battery firmware upgrade (needs the binary)
This commit is contained in:
parent
c969b72a82
commit
ec4d76f8fd
|
@ -126,7 +126,7 @@ public class Controller : ControllerBase
|
||||||
var data = new
|
var data = new
|
||||||
{
|
{
|
||||||
inst = installsForHtml,
|
inst = installsForHtml,
|
||||||
serverIp = "10.2.0.1",
|
serverIp = "10.2.0.1", //TODO MAKE ME DYNAMIC
|
||||||
firmwareVersion = FirmwareVersion
|
firmwareVersion = FirmwareVersion
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ public class Controller : ControllerBase
|
||||||
return new AcceptedResult();
|
return new AcceptedResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SendNewBatteryFirmware(String installationIp)
|
private static void SendNewBatteryFirmware(String installationIp)
|
||||||
{
|
{
|
||||||
Cli.Wrap("scp")
|
Cli.Wrap("scp")
|
||||||
.WithArguments($@"{FirmwareVersion}.bin")
|
.WithArguments($@"{FirmwareVersion}.bin")
|
||||||
|
|
|
@ -90,6 +90,9 @@ public static partial class Db
|
||||||
await NumberOfBatteries(ip[0], ip[1]),
|
await NumberOfBatteries(ip[0], ip[1]),
|
||||||
await BatteryFirmwareVersion(ip[0], ip[1]));
|
await BatteryFirmwareVersion(ip[0], ip[1]));
|
||||||
|
|
||||||
|
if (ip[0] != "Unknown")
|
||||||
|
await UpdateInstallationName(installation, ip[0]);
|
||||||
|
|
||||||
if (GetInstallationByIdentifier(installation.Identifier) == null)
|
if (GetInstallationByIdentifier(installation.Identifier) == null)
|
||||||
{
|
{
|
||||||
Create(updatedInstallation);
|
Create(updatedInstallation);
|
||||||
|
@ -165,10 +168,9 @@ public static partial class Db
|
||||||
|
|
||||||
var ip = await VpnInfo.LookUpIp(i.Identifier, details.MachineSerial()) ?? "Unknown";
|
var ip = await VpnInfo.LookUpIp(i.Identifier, details.MachineSerial()) ?? "Unknown";
|
||||||
|
|
||||||
if (ip != "Unknown")
|
var installationDetails = new InstallationDetails(ip, details);
|
||||||
await UpdateInstallationName(i, ip);
|
|
||||||
|
|
||||||
return new InstallationDetails(ip, details);
|
return installationDetails;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue