Skip to content

Commit

Permalink
Addresses #125, adds an authed endpoint to get current device json
Browse files Browse the repository at this point in the history
  • Loading branch information
i8beef committed Jan 12, 2021
1 parent a43a2b7 commit e668c8d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ public IActionResult SyncValidate()
return Json(response);
}

/// <summary>
/// Gets a device json for external validation.
/// </summary>
/// <returns>Response.</returns>
public IActionResult Json()
{
return Json(_deviceRepository.GetAll().ToDictionary(device => device.Id, device => device));
}

/// <summary>
/// Create device.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/HomeAutio.Mqtt.GoogleHome/Views/GoogleDevice/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
<p>
Paste into the <a href="https://developers.google.com/assistant/smarthome/tools/validator">Google Validator</a> to check for issues.
</p>

<a asp-controller="GoogleDevice" asp-action="Json" class="btn btn-warning">Device JSON</a>
<p>
Current device JSON
</p>
</div>
</div>
</div>
Expand Down

0 comments on commit e668c8d

Please sign in to comment.