File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/HassModel/NetDaemon.HassModel/Internal Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,12 @@ private void HandleEvent(HassEvent hassEvent)
5252 public EntityState ? GetState ( string entityId )
5353 {
5454 return ! _initialized
55- ? throw new InvalidOperationException ( "StateCache has not been initialized yet" )
56- : ( _latestStates . GetValueOrDefault ( entityId ) ? . Value ) ;
55+ ? throw new InvalidOperationException (
56+ "StateCache has not been initialized. This may occur if NetDaemon has not yet completed its initial connection to Home Assistant. " +
57+ "This should not happen with a standard NetDaemon deployment. If you're using a custom deployment, ensure that initialization is complete " +
58+ "before accessing entity state by awaiting `WaitForInitializationAsync` on `INetDaemonRuntime`."
59+ )
60+ : _latestStates . GetValueOrDefault ( entityId ) ? . Value ;
5761 }
5862
5963 public void Dispose ( )
You can’t perform that action at this time.
0 commit comments