add batteryVoltage and percent
This commit is contained in:
@@ -26,6 +26,8 @@ public sealed class TelemetryDto
|
|||||||
public decimal SoilPercent { get; set; }
|
public decimal SoilPercent { get; set; }
|
||||||
public int GasPPM { get; set; }
|
public int GasPPM { get; set; }
|
||||||
public decimal? Voltage { get; set; }
|
public decimal? Voltage { get; set; }
|
||||||
|
public decimal? BatteryVoltage { get; set; }
|
||||||
|
public decimal? BatteryPercent { get; set; }
|
||||||
public byte? Power { get; set; }
|
public byte? Power { get; set; }
|
||||||
public byte? OldPower { get; set; }
|
public byte? OldPower { get; set; }
|
||||||
public decimal Lux { get; set; }
|
public decimal Lux { get; set; }
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ public sealed class TelemetryRecord
|
|||||||
|
|
||||||
[Column(TypeName = "decimal(18,2)")]
|
[Column(TypeName = "decimal(18,2)")]
|
||||||
public decimal? Voltage { get; set; }
|
public decimal? Voltage { get; set; }
|
||||||
|
public decimal? BatteryVoltage { get; set; }
|
||||||
|
public decimal? BatteryPercent { get; set; }
|
||||||
public byte? Power { get; set; }
|
public byte? Power { get; set; }
|
||||||
public int PersianYear { get; set; }
|
public int PersianYear { get; set; }
|
||||||
public int PersianMonth { get; set; }
|
public int PersianMonth { get; set; }
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ public sealed class GreenHomeDbContext : DbContext
|
|||||||
b.Property(x => x.Lux).HasColumnType("decimal(18,2)");
|
b.Property(x => x.Lux).HasColumnType("decimal(18,2)");
|
||||||
b.Property(x => x.PersianDate).HasMaxLength(10);
|
b.Property(x => x.PersianDate).HasMaxLength(10);
|
||||||
b.Property(x => x.Voltage).HasColumnType("decimal(18,2)");
|
b.Property(x => x.Voltage).HasColumnType("decimal(18,2)");
|
||||||
|
b.Property(x => x.BatteryVoltage).HasColumnType("decimal(18,2)");
|
||||||
|
b.Property(x => x.BatteryPercent).HasColumnType("decimal(18,2)");
|
||||||
b.HasIndex(x => new { x.DeviceId, x.PersianYear, x.PersianMonth });
|
b.HasIndex(x => new { x.DeviceId, x.PersianYear, x.PersianMonth });
|
||||||
b.HasIndex(x => new { x.DeviceId, x.TimestampUtc });
|
b.HasIndex(x => new { x.DeviceId, x.TimestampUtc });
|
||||||
b.HasIndex(x => new { x.DeviceId, x.ServerTimestampUtc });
|
b.HasIndex(x => new { x.DeviceId, x.ServerTimestampUtc });
|
||||||
|
|||||||
1246
src/GreenHome.Infrastructure/Migrations/20260113032844_AddBatteryInfoFields.Designer.cs
generated
Normal file
1246
src/GreenHome.Infrastructure/Migrations/20260113032844_AddBatteryInfoFields.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace GreenHome.Infrastructure.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddBatteryInfoFields : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<decimal>(
|
||||||
|
name: "BatteryPercent",
|
||||||
|
table: "Telemetry",
|
||||||
|
type: "decimal(18,2)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<decimal>(
|
||||||
|
name: "BatteryVoltage",
|
||||||
|
table: "Telemetry",
|
||||||
|
type: "decimal(18,2)",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "BatteryPercent",
|
||||||
|
table: "Telemetry");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "BatteryVoltage",
|
||||||
|
table: "Telemetry");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -727,6 +727,12 @@ namespace GreenHome.Infrastructure.Migrations
|
|||||||
|
|
||||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<decimal?>("BatteryPercent")
|
||||||
|
.HasColumnType("decimal(18,2)");
|
||||||
|
|
||||||
|
b.Property<decimal?>("BatteryVoltage")
|
||||||
|
.HasColumnType("decimal(18,2)");
|
||||||
|
|
||||||
b.Property<int>("DeviceId")
|
b.Property<int>("DeviceId")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user