Fix app and save on id add
This commit is contained in:
@@ -26,11 +26,18 @@ namespace PlantBox.Broker
|
||||
// State conditions
|
||||
public void UpdateState()
|
||||
{
|
||||
bool IsDay()
|
||||
{
|
||||
double hour = DateTime.Now.Hour;
|
||||
|
||||
return hour > 8 && hour < 20;
|
||||
}
|
||||
|
||||
if (Humidity.Value < Humidity.Min || Humidity.Value > Humidity.Max)
|
||||
{
|
||||
State = PlantState.Warning;
|
||||
}
|
||||
if (Luminosity.Value < Luminosity.Min || Luminosity.Value > Luminosity.Max)
|
||||
if (IsDay() && Luminosity.Value < Luminosity.Min || Luminosity.Value > Luminosity.Max)
|
||||
{
|
||||
State = PlantState.Warning;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,10 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidManagedSymbols>true</AndroidManagedSymbols>
|
||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||
<AotAssemblies>false</AotAssemblies>
|
||||
<EnableLLVM>false</EnableLLVM>
|
||||
<BundleAssemblies>false</BundleAssemblies>
|
||||
<MandroidI18n />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Mono.Android" />
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace PlantBox.Client.Forms
|
||||
{
|
||||
App.Settings.IDs.Add(id);
|
||||
|
||||
await App.Settings.SaveAsync();
|
||||
await Refresh();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user