mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-11 10:45:00 +00:00
cleaned out framework files; added framework submodule; referneced p.core to reference in framework; moved essentials.sln; changed paths in sln to match; test build
This commit is contained in:
67
PepperDashEssentials/Config/EssentialsConfig.cs
Normal file
67
PepperDashEssentials/Config/EssentialsConfig.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
/// <summary>
|
||||
/// Loads the ConfigObject from the file
|
||||
/// </summary>
|
||||
public class EssentialsConfig : BasicConfig
|
||||
{
|
||||
[JsonProperty("system_url")]
|
||||
public string SystemUrl { get; set; }
|
||||
|
||||
[JsonProperty("template_url")]
|
||||
public string TemplateUrl { get; set; }
|
||||
|
||||
|
||||
//public CotijaConfig Cotija { get; private set; }
|
||||
|
||||
[JsonProperty("systemUuid")]
|
||||
public string SystemUuid
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = Regex.Match(SystemUrl, @"https?:\/\/.*\/systems\/(.*)\/#.*");
|
||||
|
||||
string uuid = result.Groups[1].Value;
|
||||
|
||||
return uuid;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("templateUuid")]
|
||||
public string TemplateUuid
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = Regex.Match(TemplateUrl, @"https?:\/\/.*\/templates\/(.*)\/#.*");
|
||||
|
||||
string uuid = result.Groups[1].Value;
|
||||
|
||||
return uuid;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("rooms")]
|
||||
public List<EssentialsRoomConfig> Rooms { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class SystemTemplateConfigs
|
||||
{
|
||||
public EssentialsConfig System { get; set; }
|
||||
|
||||
public EssentialsConfig Template { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user