Skip to content

Commit

Permalink
v1.4.0-beta.49
Browse files Browse the repository at this point in the history
- Fixes bug not allowing to add new automation programs (!)
  • Loading branch information
genemars committed Sep 19, 2023
1 parent abb5c6a commit d7a8f49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/HomeGenie/Service/Handlers/Automation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,14 @@ public void ProcessRequest(MigClientRequest request)
if (newProgram != null)
{
newProgram.Address = homegenie.ProgramManager.GeneratePid();
// add new program: this must be done before compiling, otherwise will throw an error due to HomeGenie service reference not set
homegenie.ProgramManager.ProgramAdd(newProgram);
if (newProgram.Type.ToLower() == "visual" || newProgram.Type.ToLower() == "csharp")
{
(newProgram.Engine as CSharpEngine)?.CleanupFiles();
(newProgram.Engine as CSharpEngine)?.Compile();
}
newProgram.IsEnabled = true;
homegenie.ProgramManager.ProgramAdd(newProgram);
homegenie.UpdateProgramsDatabase();
request.ResponseData = new ResponseText(newProgram.Address.ToString());
}
Expand Down

0 comments on commit d7a8f49

Please sign in to comment.