diff --git a/PlantBox.Broker/PlantBox.cs b/PlantBox.Broker/PlantBox.cs index 8ad64d7..e947e49 100644 --- a/PlantBox.Broker/PlantBox.cs +++ b/PlantBox.Broker/PlantBox.cs @@ -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; } diff --git a/PlantBox.Client/PlantBox.Client.Android/PlantBox.Client.Android.csproj b/PlantBox.Client/PlantBox.Client.Android/PlantBox.Client.Android.csproj index 978d123..42bbecd 100644 --- a/PlantBox.Client/PlantBox.Client.Android/PlantBox.Client.Android.csproj +++ b/PlantBox.Client/PlantBox.Client.Android/PlantBox.Client.Android.csproj @@ -46,6 +46,10 @@ 4 true false + false + false + false + diff --git a/PlantBox.Client/PlantBox.Client/Forms/HomePage.xaml.cs b/PlantBox.Client/PlantBox.Client/Forms/HomePage.xaml.cs index 5d7fe80..193dbc5 100644 --- a/PlantBox.Client/PlantBox.Client/Forms/HomePage.xaml.cs +++ b/PlantBox.Client/PlantBox.Client/Forms/HomePage.xaml.cs @@ -56,6 +56,7 @@ namespace PlantBox.Client.Forms { App.Settings.IDs.Add(id); + await App.Settings.SaveAsync(); await Refresh(); } else