INNER CODE UNIT · C#

ApiEndpoints

LAB02-Research/HASS.Agent · src/HASS.Agent/API/ApiEndpoints.cs:17

    public class ApiEndpoints : ApiDeserialization
    {
        /// <summary>
        /// Info routes, provides device info on /info
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public static async Task DeviceInfoRoute(IHttpContext context)
        {
            context.Response.ContentType = "application/json";
            await context.Response.SendResponseAsync(JsonSerializer.Serialize(new
            {
                serial_number = Variables.SerialNumber,
                device = Variables.DeviceConfig,
                apis = new
                {
                    notifications = Variables.AppSettings.NotificationsEnabled,
                    media_player = Variables.AppSettings.MediaPlayerEnabled

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…