Skip to content

Commit

Permalink
Updated schema files and move to generating enum classes from newly a…
Browse files Browse the repository at this point in the history
…vailable schemas
  • Loading branch information
i8beef committed Jan 12, 2021
1 parent e668c8d commit 5ed6a15
Show file tree
Hide file tree
Showing 23 changed files with 519 additions and 406 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static Device FullDevice()
return new Device
{
Id = "test/device",
Type = GoogleHome.Models.DeviceType.Light,
Type = GoogleHome.Models.DeviceType.LIGHT,
Disabled = false,
WillReportState = false,
RoomHint = "Test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public GoogleDeviceController(
IGoogleDeviceRepository deviceRepository,
SyncIntentHandler syncIntentHandler)
{
_deviceRepository = deviceRepository ?? throw new ArgumentException(nameof(deviceRepository));
_syncIntentHandler = syncIntentHandler ?? throw new ArgumentException(nameof(syncIntentHandler));
_deviceRepository = deviceRepository ?? throw new ArgumentNullException(nameof(deviceRepository));
_syncIntentHandler = syncIntentHandler ?? throw new ArgumentNullException(nameof(syncIntentHandler));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class GoogleTraitController : Controller
/// <param name="deviceRepository">Device repository.</param>
public GoogleTraitController(IGoogleDeviceRepository deviceRepository)
{
_deviceRepository = deviceRepository ?? throw new ArgumentException(nameof(deviceRepository));
_deviceRepository = deviceRepository ?? throw new ArgumentNullException(nameof(deviceRepository));
}

/// <summary>
Expand Down Expand Up @@ -289,7 +289,6 @@ public IActionResult Examples([Required] string traitId)
}
}


var examples = new
{
AttributeExamples = targetSchema.AttributeSchema?.Examples,
Expand All @@ -306,7 +305,7 @@ public IActionResult Examples([Required] string traitId)
/// <param name="commandName">Command name.</param>
/// <param name="example">Example.</param>
/// <returns>Command delegation example string.</returns>
private string GetWrappedCommandExample(string commandName, string example = null)
private static string GetWrappedCommandExample(string commandName, string example = null)
{
var sb = new StringBuilder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public SyncIntentHandler(
IConfiguration configuration,
IGoogleDeviceRepository deviceRepository)
{
_log = logger ?? throw new ArgumentException(nameof(logger));
_messageHub = messageHub ?? throw new ArgumentException(nameof(messageHub));
_config = configuration ?? throw new ArgumentException(nameof(configuration));
_deviceRepository = deviceRepository ?? throw new ArgumentException(nameof(deviceRepository));
_log = logger ?? throw new ArgumentNullException(nameof(logger));
_messageHub = messageHub ?? throw new ArgumentNullException(nameof(messageHub));
_config = configuration ?? throw new ArgumentNullException(nameof(configuration));
_deviceRepository = deviceRepository ?? throw new ArgumentNullException(nameof(deviceRepository));
}

/// <summary>
Expand Down
8 changes: 4 additions & 4 deletions src/HomeAutio.Mqtt.GoogleHome/Models/CommandType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,15 @@ public enum CommandType
Reboot,

/// <summary>
/// action.devices.commands.RelativeChannel
/// action.devices.commands.relativeChannel
/// </summary>
[EnumMember(Value = "action.devices.commands.RelativeChannel")]
[EnumMember(Value = "action.devices.commands.relativeChannel")]
RelativeChannel,

/// <summary>
/// action.devices.commands.ReturnChannel
/// action.devices.commands.returnChannel
/// </summary>
[EnumMember(Value = "action.devices.commands.ReturnChannel")]
[EnumMember(Value = "action.devices.commands.returnChannel")]
ReturnChannel,

/// <summary>
Expand Down
Loading

0 comments on commit 5ed6a15

Please sign in to comment.