Skip to content

Commit

Permalink
Fix some warnings in tesproject (#400)
Browse files Browse the repository at this point in the history
* Fix some warnings in tesproject
  • Loading branch information
FrankBakkerNl committed Jul 5, 2021
1 parent 5660244 commit 6b42d11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Fakes/NetDaemon.Fakes/DaemonHostTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void SetEntityState(string entityId, object? state = null, string? area =
DefaultDaemonHost.StateManager.Store(new HassState()
{
EntityId = entityId,
State = state.ToString()
State = state?.ToString()
});

if (area == null) return;
Expand Down
8 changes: 4 additions & 4 deletions src/Fakes/NetDaemon.Fakes/HassClientMock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void AddChangedEvent(string entityId, object fromState, object toState, D
EntityId = entityId,
NewState = new HassState
{
State = toState.ToString(),
State = toState?.ToString(),
Attributes = new Dictionary<string, object>
{
["device_class"] = "motion"
Expand All @@ -180,7 +180,7 @@ public void AddChangedEvent(string entityId, object fromState, object toState, D
},
OldState = new HassState
{
State = fromState.ToString(),
State = fromState?.ToString(),
Attributes = new Dictionary<string, object>
{
["device_class"] = "motion"
Expand All @@ -207,7 +207,7 @@ public void AddChangedEvent(string entityId, object fromState, object toState)
NewState = new HassState
{
EntityId = entityId,
State = toState.ToString(),
State = toState?.ToString(),
Attributes = new Dictionary<string, object>
{
["device_class"] = "motion"
Expand All @@ -218,7 +218,7 @@ public void AddChangedEvent(string entityId, object fromState, object toState)
OldState = new HassState
{
EntityId = entityId,
State = fromState.ToString(),
State = fromState?.ToString(),
Attributes = new Dictionary<string, object>
{
["device_class"] = "motion"
Expand Down

0 comments on commit 6b42d11

Please sign in to comment.