-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added scenes with trigger/undo support, renamed Device NS to Models, …
…renamed Refresh to LoadAll
- Loading branch information
1 parent
d624b5f
commit 42dd54a
Showing
12 changed files
with
120 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Dirigera.Lib.Api.Dto | ||
{ | ||
internal class SceneDto | ||
{ | ||
public string? Id { get; set; } | ||
public SceneInfoDto? Info { get; set; } | ||
public string? Type { get; set; } | ||
public string? CreatedAt { get; set; } | ||
public string? LastCompleted { get; set; } | ||
public string? LastTriggered { get; set; } | ||
public int UndoAllowedDuration { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Dirigera.Lib.Api.Dto | ||
{ | ||
internal class SceneInfoDto | ||
{ | ||
public string? Name { get; set; } | ||
public string? Icon { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...a.Lib/Dirigera.Lib/Devices/Base/Device.cs → ...ra.Lib/Dirigera.Lib/Models/Base/Device.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Dirigera.Lib/Dirigera.Lib/Devices/Blind.cs → Dirigera.Lib/Dirigera.Lib/Models/Blind.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Dirigera.Lib/Devices/EnvironmentSensor.cs → .../Dirigera.Lib/Models/EnvironmentSensor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Dirigera.Lib/Dirigera.Lib/Devices/Hub.cs → Dirigera.Lib/Dirigera.Lib/Models/Hub.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Dirigera.Lib/Dirigera.Lib/Devices/Light.cs → Dirigera.Lib/Dirigera.Lib/Models/Light.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Dirigera.Lib/Dirigera.Lib/Devices/Outlet.cs → Dirigera.Lib/Dirigera.Lib/Models/Outlet.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
Dirigera.Lib/Dirigera.Lib/Devices/Room.cs → Dirigera.Lib/Dirigera.Lib/Models/Room.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
namespace Dirigera.Lib.Models | ||
{ | ||
public class Scene | ||
{ | ||
private readonly DirigeraManager _dirigeraManager; | ||
|
||
public string? Id { get; internal set; } | ||
public string? Name { get; internal set; } | ||
public string? Icon { get; internal set; } | ||
public string? Type { get; set; } | ||
public string? CreatedAt { get; set; } | ||
public string? LastCompleted { get; set; } | ||
public string? LastTriggered { get; set; } | ||
public int UndoAllowedDuration { get; set; } | ||
|
||
internal Scene(DirigeraManager dirigeraManager) | ||
{ | ||
_dirigeraManager = dirigeraManager; | ||
} | ||
|
||
public async Task Trigger() | ||
{ | ||
await _dirigeraManager.TriggerScene(this); | ||
} | ||
|
||
public async Task Undo() | ||
{ | ||
await _dirigeraManager.UndoScene(this); | ||
} | ||
} | ||
} |