Notification and parking zones
All checks were successful
Build, Push and Run Container / build (push) Successful in 37s
All checks were successful
Build, Push and Run Container / build (push) Successful in 37s
This commit is contained in:
47
Source/ProofOfConcept/Models/ParkingState.cs
Normal file
47
Source/ProofOfConcept/Models/ParkingState.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
namespace ProofOfConcept.Models;
|
||||
|
||||
public class ParkingState
|
||||
{
|
||||
public bool CarParked { get; set; }
|
||||
public bool ParkingInProgress { get; set; }
|
||||
|
||||
public DateTimeOffset? CarParkedAt { get; set; }
|
||||
public DateTimeOffset? ParkingStartedAt { get; set; }
|
||||
public DateTimeOffset? ParkingStoppedAt { get; set; }
|
||||
|
||||
public void SetCarParked()
|
||||
{
|
||||
if (!CarParked)
|
||||
{
|
||||
CarParked = true;
|
||||
CarParkedAt = DateTimeOffset.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetCarMoved()
|
||||
{
|
||||
if (CarParked)
|
||||
{
|
||||
CarParked = false;
|
||||
CarParkedAt = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetParkingStarted()
|
||||
{
|
||||
if (!ParkingInProgress)
|
||||
{
|
||||
ParkingInProgress = true;
|
||||
ParkingStartedAt = DateTimeOffset.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetParkingStopped()
|
||||
{
|
||||
if (ParkingInProgress)
|
||||
{
|
||||
ParkingInProgress = false;
|
||||
ParkingStoppedAt = DateTimeOffset.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
73
Source/ProofOfConcept/Models/TeslaState.cs
Normal file
73
Source/ProofOfConcept/Models/TeslaState.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
namespace ProofOfConcept.Models;
|
||||
|
||||
public class TeslaState
|
||||
{
|
||||
private string gear = "";
|
||||
private bool locked;
|
||||
private bool driverSeatOccupied;
|
||||
private bool gpsState;
|
||||
private double latitude;
|
||||
private double longitude;
|
||||
|
||||
public string Gear
|
||||
{
|
||||
get => this.gear;
|
||||
set
|
||||
{
|
||||
this.gear = value;
|
||||
LastUpdate = DateTimeOffset.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Locked
|
||||
{
|
||||
get => this.locked;
|
||||
set
|
||||
{
|
||||
this.locked = value;
|
||||
LastUpdate = DateTimeOffset.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public bool DriverSeatOccupied
|
||||
{
|
||||
get => this.driverSeatOccupied;
|
||||
set
|
||||
{
|
||||
this.driverSeatOccupied = value;
|
||||
LastUpdate = DateTimeOffset.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public bool GPSState
|
||||
{
|
||||
get => this.gpsState;
|
||||
set
|
||||
{
|
||||
this.gpsState = value;
|
||||
LastUpdate = DateTimeOffset.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public double Latitude
|
||||
{
|
||||
get => this.latitude;
|
||||
set
|
||||
{
|
||||
this.latitude = value;
|
||||
LastUpdate = DateTimeOffset.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public double Longitude
|
||||
{
|
||||
get => this.longitude;
|
||||
set
|
||||
{
|
||||
this.longitude = value;
|
||||
LastUpdate = DateTimeOffset.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public DateTimeOffset LastUpdate { get; private set; }
|
||||
}
|
||||
Reference in New Issue
Block a user