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