NotifyServices Nachrichten sind unzuverlässt versendet werden . NotifyServices wird bei den Methoden jetzt übergeben.
This commit is contained in:
@@ -101,19 +101,19 @@ namespace NetDaemonApps.AreaControl
|
||||
|
||||
}
|
||||
|
||||
public virtual void SunDawn()
|
||||
public virtual void SunDawn(NotifyServices notifyServices)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void SunRising()
|
||||
public virtual void SunRising(NotifyServices notifyServices)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void SunDusk()
|
||||
public virtual void SunDusk(NotifyServices notifyServices)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void SunSetting()
|
||||
public virtual void SunSetting(NotifyServices notifyServices)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
||||
/// <summary>
|
||||
/// Morgendämmerung
|
||||
/// </summary>
|
||||
public override void SunDawn()
|
||||
public override void SunDawn(NotifyServices notifyServices)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
||||
/// <summary>
|
||||
/// Sonnenaufgang
|
||||
/// </summary>
|
||||
public override void SunRising()
|
||||
public override void SunRising(NotifyServices notifyServices)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
||||
/// <summary>
|
||||
/// Abenddämmerung
|
||||
/// </summary>
|
||||
public override void SunDusk()
|
||||
public override void SunDusk(NotifyServices notifyServices)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -44,7 +44,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
||||
/// <summary>
|
||||
/// Sonnenuntergang
|
||||
/// </summary>
|
||||
public override void SunSetting()
|
||||
public override void SunSetting(NotifyServices notifyServices)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
||||
/// <summary>
|
||||
/// Morgendämmerung
|
||||
/// </summary>
|
||||
public override void SunDawn()
|
||||
public override void SunDawn(NotifyServices notifyServices)
|
||||
{
|
||||
notifyServices.Whatsapp("Morgendämmerung");
|
||||
}
|
||||
@@ -101,7 +101,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
||||
/// <summary>
|
||||
/// Sonnenaufgang
|
||||
/// </summary>
|
||||
public override void SunRising()
|
||||
public override void SunRising(NotifyServices notifyServices)
|
||||
{
|
||||
notifyServices.Whatsapp("Sonnenaufgang");
|
||||
}
|
||||
@@ -109,7 +109,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
||||
/// <summary>
|
||||
/// Abenddämmerung
|
||||
/// </summary>
|
||||
public override void SunDusk()
|
||||
public override void SunDusk(NotifyServices notifyServices)
|
||||
{
|
||||
notifyServices.Whatsapp("Abenddämmerung");
|
||||
}
|
||||
@@ -117,7 +117,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
||||
/// <summary>
|
||||
/// Sonnenuntergang
|
||||
/// </summary>
|
||||
public override void SunSetting()
|
||||
public override void SunSetting(NotifyServices notifyServices)
|
||||
{
|
||||
notifyServices.Whatsapp("Sonnenuntergang");
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="AreaControl\Areas\" />
|
||||
<Folder Include="Properties\PublishProfiles\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -21,43 +21,43 @@ namespace NetDaemonApps.apps
|
||||
AreaCollection = areaCollection;
|
||||
notifyServices = new NotifyServices(haContext);
|
||||
|
||||
scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextDawn.State), () => SunDawn()); // Morgendämmerung
|
||||
scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextRising.State), () => SunRising()); // Sonnenaufgang
|
||||
scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextDawn.State), () => SunDawn(notifyServices)); // Morgendämmerung
|
||||
scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextRising.State), () => SunRising(notifyServices)); // Sonnenaufgang
|
||||
|
||||
scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextDusk.State), () => SunDusk()); // Abenddämmerung
|
||||
scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextSetting.State), () => SunSetting()); // Sonnenuntergang
|
||||
scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextDusk.State), () => SunDusk(notifyServices)); // Abenddämmerung
|
||||
scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextSetting.State), () => SunSetting(notifyServices)); // Sonnenuntergang
|
||||
|
||||
}
|
||||
|
||||
private void SunDawn()
|
||||
private void SunDawn(NotifyServices notifyServices)
|
||||
{
|
||||
foreach (var area in Enum.GetValues(typeof(AreaControlEnum)))
|
||||
{
|
||||
AreaCollection.GetArea((AreaControlEnum)area).SunDawn();
|
||||
AreaCollection.GetArea((AreaControlEnum)area).SunDawn(notifyServices);
|
||||
}
|
||||
}
|
||||
|
||||
private async void SunRising()
|
||||
private async void SunRising(NotifyServices notifyServices)
|
||||
{
|
||||
foreach (var area in Enum.GetValues(typeof(AreaControlEnum)))
|
||||
{
|
||||
AreaCollection.GetArea((AreaControlEnum)area).SunRising();
|
||||
AreaCollection.GetArea((AreaControlEnum)area).SunRising(notifyServices);
|
||||
}
|
||||
}
|
||||
|
||||
private void SunDusk()
|
||||
private void SunDusk(NotifyServices notifyServices)
|
||||
{
|
||||
foreach (var area in Enum.GetValues(typeof(AreaControlEnum)))
|
||||
{
|
||||
AreaCollection.GetArea((AreaControlEnum)area).SunDusk();
|
||||
AreaCollection.GetArea((AreaControlEnum)area).SunDusk(notifyServices);
|
||||
}
|
||||
}
|
||||
|
||||
private void SunSetting()
|
||||
private void SunSetting(NotifyServices notifyServices)
|
||||
{
|
||||
foreach (var area in Enum.GetValues(typeof(AreaControlEnum)))
|
||||
{
|
||||
AreaCollection.GetArea((AreaControlEnum)area).SunSetting();
|
||||
AreaCollection.GetArea((AreaControlEnum)area).SunSetting(notifyServices);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ using NetDaemonInterface;
|
||||
|
||||
try
|
||||
{
|
||||
Console.WriteLine("Starting v0.0.0");
|
||||
Console.WriteLine("Starting v0.1");
|
||||
|
||||
await Host.CreateDefaultBuilder(args)
|
||||
.UseNetDaemonAppSettings()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using NetDaemonInterface;
|
||||
using HomeAssistantGenerated;
|
||||
using NetDaemonInterface;
|
||||
|
||||
namespace NetDaemonInterface;
|
||||
|
||||
@@ -17,21 +18,21 @@ public interface IAreaControl
|
||||
/// <summary>
|
||||
/// Morgendämmerung
|
||||
/// </summary>
|
||||
public void SunDawn();
|
||||
public void SunDawn(NotifyServices notifyServices);
|
||||
|
||||
/// <summary>
|
||||
/// Sonnenaufgang
|
||||
/// </summary>
|
||||
public void SunRising();
|
||||
public void SunRising(NotifyServices notifyServices);
|
||||
|
||||
/// <summary>
|
||||
/// Abenddämmerung
|
||||
/// </summary>
|
||||
public void SunDusk();
|
||||
public void SunDusk(NotifyServices notifyServices);
|
||||
|
||||
/// <summary>
|
||||
/// Sonnenuntergang
|
||||
/// </summary>
|
||||
public void SunSetting();
|
||||
public void SunSetting(NotifyServices notifyServices);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user