Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1898ceb79a | |||
| dd6cb90ea6 |
@@ -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>
|
/// <summary>
|
||||||
/// Morgendämmerung
|
/// Morgendämmerung
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void SunDawn()
|
public override void SunDawn(NotifyServices notifyServices)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sonnenaufgang
|
/// Sonnenaufgang
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void SunRising()
|
public override void SunRising(NotifyServices notifyServices)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Abenddämmerung
|
/// Abenddämmerung
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void SunDusk()
|
public override void SunDusk(NotifyServices notifyServices)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sonnenuntergang
|
/// Sonnenuntergang
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void SunSetting()
|
public override void SunSetting(NotifyServices notifyServices)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Morgendämmerung
|
/// Morgendämmerung
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void SunDawn()
|
public override void SunDawn(NotifyServices notifyServices)
|
||||||
{
|
{
|
||||||
notifyServices.Whatsapp("Morgendämmerung");
|
notifyServices.Whatsapp("Morgendämmerung");
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sonnenaufgang
|
/// Sonnenaufgang
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void SunRising()
|
public override void SunRising(NotifyServices notifyServices)
|
||||||
{
|
{
|
||||||
notifyServices.Whatsapp("Sonnenaufgang");
|
notifyServices.Whatsapp("Sonnenaufgang");
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Abenddämmerung
|
/// Abenddämmerung
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void SunDusk()
|
public override void SunDusk(NotifyServices notifyServices)
|
||||||
{
|
{
|
||||||
notifyServices.Whatsapp("Abenddämmerung");
|
notifyServices.Whatsapp("Abenddämmerung");
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ namespace NetDaemonApps.AreaControl.Areas
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sonnenuntergang
|
/// Sonnenuntergang
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void SunSetting()
|
public override void SunSetting(NotifyServices notifyServices)
|
||||||
{
|
{
|
||||||
notifyServices.Whatsapp("Sonnenuntergang");
|
notifyServices.Whatsapp("Sonnenuntergang");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,6 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="AreaControl\Areas\" />
|
<Folder Include="AreaControl\Areas\" />
|
||||||
<Folder Include="Properties\PublishProfiles\" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Any CPU</Platform>
|
||||||
|
<PublishDir>\\10.10.192.3\config\netdaemon3</PublishDir>
|
||||||
|
<PublishProtocol>FileSystem</PublishProtocol>
|
||||||
|
<_TargetId>Folder</_TargetId>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -21,43 +21,43 @@ namespace NetDaemonApps.apps
|
|||||||
AreaCollection = areaCollection;
|
AreaCollection = areaCollection;
|
||||||
notifyServices = new NotifyServices(haContext);
|
notifyServices = new NotifyServices(haContext);
|
||||||
|
|
||||||
scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextDawn.State), () => SunDawn()); // Morgendämmerung
|
scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextDawn.State), () => SunDawn(notifyServices)); // Morgendämmerung
|
||||||
scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextRising.State), () => SunRising()); // Sonnenaufgang
|
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.SunNextDusk.State), () => SunDusk(notifyServices)); // Abenddämmerung
|
||||||
scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextSetting.State), () => SunSetting()); // Sonnenuntergang
|
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)))
|
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)))
|
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)))
|
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)))
|
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
|
try
|
||||||
{
|
{
|
||||||
Console.WriteLine("Starting v0.0.0");
|
Console.WriteLine("Starting v0.1");
|
||||||
|
|
||||||
await Host.CreateDefaultBuilder(args)
|
await Host.CreateDefaultBuilder(args)
|
||||||
.UseNetDaemonAppSettings()
|
.UseNetDaemonAppSettings()
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using NetDaemonInterface;
|
using HomeAssistantGenerated;
|
||||||
|
using NetDaemonInterface;
|
||||||
|
|
||||||
namespace NetDaemonInterface;
|
namespace NetDaemonInterface;
|
||||||
|
|
||||||
@@ -17,21 +18,21 @@ public interface IAreaControl
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Morgendämmerung
|
/// Morgendämmerung
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SunDawn();
|
public void SunDawn(NotifyServices notifyServices);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sonnenaufgang
|
/// Sonnenaufgang
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SunRising();
|
public void SunRising(NotifyServices notifyServices);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Abenddämmerung
|
/// Abenddämmerung
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SunDusk();
|
public void SunDusk(NotifyServices notifyServices);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sonnenuntergang
|
/// Sonnenuntergang
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SunSetting();
|
public void SunSetting(NotifyServices notifyServices);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user