This section describes the 'Version 2 API'. We are currently moving all our new development towards the new HassModel API and encourage you to us that API for new development. The 'Version2 API' will be around long enough for reasonable adoption.
The netdaemon API is used to access Home Assistant features. The version 2 is based on System.Reactive API.
System.Reactive contains scheduling. We strongly suggesst using the built-in to make sure errors are logged and your automations works as expected.
Add new reference to your dev project file
dotnet add package System.Reactive on the
daemonapp.csproj (if you are not using the dev template your project is named differently).
JoySoftware.NetDaemon.DaemonRunner to the latest versions.
New base class and imports
Make sure you are using
System.Reactive.Linq. Also change to the
NetDaemon.Common.Reactive. Now you will not need async initializer anymore so use
public override void Initialize(). Forgetting to use new Initialize can introduce old async code bugs.
Change the baseclass to
public class HouseStateManager : NetDaemonRxApp
public override void Initialize()