Minor improvements; removed Password
This commit is contained in:
@@ -25,7 +25,6 @@ namespace NightScoutAlert
|
||||
Quobject.EngineIoClientDotNet.Modules.LogManager.Enabled = true;
|
||||
|
||||
//NightscoutTestConfiguration configuration = new NightscoutTestConfiguration();
|
||||
//MonoCompatibleNightscoutAlertConfiguration configuration = new MonoCompatibleNightscoutAlertConfiguration("http://nightscout.chrispr.org:8082", "ThisIsATerribleAuthSystem");
|
||||
String nightscoutEndpoint = ConfigurationManager.AppSettings["NightscoutEndpoint"];
|
||||
String nightscoutCredentials = ConfigurationManager.AppSettings["NightscoutCredentials"];
|
||||
if (String.IsNullOrEmpty(nightscoutEndpoint) || String.IsNullOrEmpty(nightscoutCredentials))
|
||||
@@ -69,68 +68,60 @@ namespace NightScoutAlert
|
||||
//
|
||||
|
||||
NightscoutAlerter nightscoutAlerter = new NightscoutAlerter(dataSource,
|
||||
new MultiAlerter(new IAlerter[] {consoleAlerter, audioAlerter, buttonSource}));
|
||||
|
||||
//var socket = IO.Socket(configuration.NightscoutBaseURL);
|
||||
|
||||
//socket.On(Socket.EVENT_CONNECT, () =>
|
||||
//{
|
||||
// Console.WriteLine("Connected...");
|
||||
// JObject authRequest = new JObject();
|
||||
// authRequest.Add("client", "web");
|
||||
|
||||
// socket.Emit("authorize", authRequest);
|
||||
//});
|
||||
//socket.On(Socket.EVENT_ERROR, (obj) =>
|
||||
//{
|
||||
// Console.WriteLine(obj.ToString());
|
||||
//});
|
||||
|
||||
//socket.On("dataUpdate", (data) =>
|
||||
//{
|
||||
// Console.WriteLine(data);
|
||||
//});
|
||||
|
||||
//socket.On("alarm", (data) =>
|
||||
//{
|
||||
// Console.WriteLine(data.ToString());
|
||||
//});
|
||||
|
||||
//socket.On(Socket.EVENT_MESSAGE, (data) =>
|
||||
//{
|
||||
// Console.WriteLine(data.ToString());
|
||||
//});
|
||||
|
||||
//socket.On("urgent_alarm", (data) =>
|
||||
//{
|
||||
// Console.WriteLine(data.ToString());
|
||||
//});
|
||||
|
||||
//socket.On("clear_alarm", (data) =>
|
||||
//{
|
||||
// Console.WriteLine(data.ToString());
|
||||
//});
|
||||
new MultiAlerter(new IAlerter[] {consoleAlerter, audioAlerter, buttonSource}));
|
||||
|
||||
//var socket = IO.Socket(configuration.NightscoutBaseURL);
|
||||
|
||||
//socket.On(Socket.EVENT_CONNECT, () =>
|
||||
//{
|
||||
// Console.WriteLine("Connected...");
|
||||
// JObject authRequest = new JObject();
|
||||
// authRequest.Add("client", "web");
|
||||
|
||||
// socket.Emit("authorize", authRequest);
|
||||
//});
|
||||
//socket.On(Socket.EVENT_ERROR, (obj) =>
|
||||
//{
|
||||
// Console.WriteLine(obj.ToString());
|
||||
//});
|
||||
|
||||
//socket.On("dataUpdate", (data) =>
|
||||
//{
|
||||
// Console.WriteLine(data);
|
||||
//});
|
||||
|
||||
//socket.On("alarm", (data) =>
|
||||
//{
|
||||
// Console.WriteLine(data.ToString());
|
||||
//});
|
||||
|
||||
//socket.On(Socket.EVENT_MESSAGE, (data) =>
|
||||
//{
|
||||
// Console.WriteLine(data.ToString());
|
||||
//});
|
||||
|
||||
//socket.On("urgent_alarm", (data) =>
|
||||
//{
|
||||
// Console.WriteLine(data.ToString());
|
||||
//});
|
||||
|
||||
//socket.On("clear_alarm", (data) =>
|
||||
//{
|
||||
// Console.WriteLine(data.ToString());
|
||||
//});
|
||||
if (args.Any(arg => arg.Equals("--test-alerts")))
|
||||
{
|
||||
Console.WriteLine("Starting alert test...");
|
||||
//RaspberryPiAudioAlert alerter = new RaspberryPiAudioAlert();
|
||||
var alerter = new MultiAlerter(new IAlerter[] { consoleAlerter, audioAlerter, buttonSource });
|
||||
alerter.StartAlert();
|
||||
Thread.Sleep(3000);
|
||||
alerter.StopAlerts();
|
||||
return;
|
||||
|
||||
}
|
||||
Console.WriteLine("Started");
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
|
||||
class NightscoutTestConfiguration : INightscoutAlertConfiguration
|
||||
{
|
||||
|
||||
public String NightscoutBaseURL
|
||||
{
|
||||
//get { return "http://straylight.chrispr.lan:8082"; }
|
||||
get { return "http://192.168.1.100:8082"; }
|
||||
set
|
||||
{throw new NotImplementedException();}
|
||||
}
|
||||
|
||||
public string APISecretKey
|
||||
{
|
||||
get { return "ThisIsATerribleAuthSystem"; }
|
||||
set
|
||||
{throw new NotImplementedException();}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user