diff --git a/src/App/NetDaemon.App/NetDaemon.App.csproj b/src/App/NetDaemon.App/NetDaemon.App.csproj
index 65fafcd59..3b566031a 100644
--- a/src/App/NetDaemon.App/NetDaemon.App.csproj
+++ b/src/App/NetDaemon.App/NetDaemon.App.csproj
@@ -23,7 +23,7 @@
-
+
diff --git a/src/Daemon/NetDaemon.Daemon/NetDaemon.Daemon.csproj b/src/Daemon/NetDaemon.Daemon/NetDaemon.Daemon.csproj
index d3859cb88..f5befce22 100644
--- a/src/Daemon/NetDaemon.Daemon/NetDaemon.Daemon.csproj
+++ b/src/Daemon/NetDaemon.Daemon/NetDaemon.Daemon.csproj
@@ -20,7 +20,7 @@
-
+
diff --git a/src/DaemonRunner/DaemonRunner/DaemonRunner.csproj b/src/DaemonRunner/DaemonRunner/DaemonRunner.csproj
index 470378463..3e8ea4b42 100644
--- a/src/DaemonRunner/DaemonRunner/DaemonRunner.csproj
+++ b/src/DaemonRunner/DaemonRunner/DaemonRunner.csproj
@@ -21,7 +21,7 @@
-
+
diff --git a/src/DaemonRunner/DaemonRunner/Service/App/CodeManager.cs b/src/DaemonRunner/DaemonRunner/Service/App/CodeManager.cs
index 34eef7863..07292efbb 100644
--- a/src/DaemonRunner/DaemonRunner/Service/App/CodeManager.cs
+++ b/src/DaemonRunner/DaemonRunner/Service/App/CodeManager.cs
@@ -427,6 +427,10 @@ public async Task> InstanceAndInitApplications(INetDa
private void LoadLocalAssemblyApplicationsForDevelopment()
{
+ var disableLoadLocalAssemblies = Environment.GetEnvironmentVariable("HASS_DISABLE_LOCAL_ASM");
+ if (disableLoadLocalAssemblies is object && disableLoadLocalAssemblies == "true")
+ return;
+
// Get daemon apps in entry assembly (mainly for development)
var apps = Assembly.GetEntryAssembly()?.GetTypes().Where(type => type.IsClass && type.IsSubclassOf(typeof(NetDaemonApp)));
if (apps != null)
diff --git a/tests/NetDaemon.Daemon.Tests/Fluent/FluentTests.cs b/tests/NetDaemon.Daemon.Tests/Fluent/FluentTests.cs
index 3197c0671..2279758f3 100644
--- a/tests/NetDaemon.Daemon.Tests/Fluent/FluentTests.cs
+++ b/tests/NetDaemon.Daemon.Tests/Fluent/FluentTests.cs
@@ -77,7 +77,29 @@ public async Task EntityOnStateChangedLamdaTurnOnLightCallsCorrectServiceCall()
}
[Fact]
- public async Task EntityOnStateChangedLamdaToggleLightCallsCorrectServiceCall()
+ public async Task EntityOnStateChangedLamdaWithMultipleEntitiesCallsCorrectServiceCall()
+ {
+ // ARRANGE
+ DefaultHassClientMock.AddChangedEvent("binary_sensor.pir", "off", "on");
+
+ var cancelSource = DefaultHassClientMock.GetSourceWithTimeout();
+ var MotionEnabled = true;
+
+ DefaultDaemonApp
+ .Entities(new string[] { "binary_sensor.pir", "binary_sensor-pir2" })
+ .WhenStateChange((to, from) => @from?.State == "off" && to?.State == "on" && MotionEnabled)
+ .UseEntity("light.correct_entity")
+ .Toggle()
+ .Execute();
+
+ await RunDefauldDaemonUntilCanceled();
+
+ DefaultHassClientMock.VerifyCallServiceTimes("toggle", Times.Once());
+ DefaultHassClientMock.VerifyCallService("light", "toggle", ("entity_id", "light.correct_entity"));
+ }
+
+ [Fact]
+ public async Task OneEntityWithSeveralShouldCallsCorrectServiceCall()
{
// ARRANGE
DefaultHassClientMock.AddChangedEvent("binary_sensor.pir", "off", "on");
diff --git a/tests/NetDaemon.Daemon.Tests/NetDaemon.Daemon.Tests.csproj b/tests/NetDaemon.Daemon.Tests/NetDaemon.Daemon.Tests.csproj
index e5a7e4839..9c2b3e903 100644
--- a/tests/NetDaemon.Daemon.Tests/NetDaemon.Daemon.Tests.csproj
+++ b/tests/NetDaemon.Daemon.Tests/NetDaemon.Daemon.Tests.csproj
@@ -17,7 +17,7 @@
all
-
+
all