Minor improvements; removed Password

This commit is contained in:
2021-06-12 22:14:24 -04:00
parent d38d9e3b7e
commit 44ee2f1baa

View File

@@ -25,7 +25,6 @@ namespace NightScoutAlert
Quobject.EngineIoClientDotNet.Modules.LogManager.Enabled = true; Quobject.EngineIoClientDotNet.Modules.LogManager.Enabled = true;
//NightscoutTestConfiguration configuration = new NightscoutTestConfiguration(); //NightscoutTestConfiguration configuration = new NightscoutTestConfiguration();
//MonoCompatibleNightscoutAlertConfiguration configuration = new MonoCompatibleNightscoutAlertConfiguration("http://nightscout.chrispr.org:8082", "ThisIsATerribleAuthSystem");
String nightscoutEndpoint = ConfigurationManager.AppSettings["NightscoutEndpoint"]; String nightscoutEndpoint = ConfigurationManager.AppSettings["NightscoutEndpoint"];
String nightscoutCredentials = ConfigurationManager.AppSettings["NightscoutCredentials"]; String nightscoutCredentials = ConfigurationManager.AppSettings["NightscoutCredentials"];
if (String.IsNullOrEmpty(nightscoutEndpoint) || String.IsNullOrEmpty(nightscoutCredentials)) if (String.IsNullOrEmpty(nightscoutEndpoint) || String.IsNullOrEmpty(nightscoutCredentials))
@@ -69,68 +68,60 @@ namespace NightScoutAlert
// //
NightscoutAlerter nightscoutAlerter = new NightscoutAlerter(dataSource, NightscoutAlerter nightscoutAlerter = new NightscoutAlerter(dataSource,
new MultiAlerter(new IAlerter[] {consoleAlerter, audioAlerter, buttonSource})); new MultiAlerter(new IAlerter[] {consoleAlerter, audioAlerter, buttonSource}));
//var socket = IO.Socket(configuration.NightscoutBaseURL); //var socket = IO.Socket(configuration.NightscoutBaseURL);
//socket.On(Socket.EVENT_CONNECT, () => //socket.On(Socket.EVENT_CONNECT, () =>
//{ //{
// Console.WriteLine("Connected..."); // Console.WriteLine("Connected...");
// JObject authRequest = new JObject(); // JObject authRequest = new JObject();
// authRequest.Add("client", "web"); // authRequest.Add("client", "web");
// socket.Emit("authorize", authRequest); // socket.Emit("authorize", authRequest);
//}); //});
//socket.On(Socket.EVENT_ERROR, (obj) => //socket.On(Socket.EVENT_ERROR, (obj) =>
//{ //{
// Console.WriteLine(obj.ToString()); // Console.WriteLine(obj.ToString());
//}); //});
//socket.On("dataUpdate", (data) => //socket.On("dataUpdate", (data) =>
//{ //{
// Console.WriteLine(data); // Console.WriteLine(data);
//}); //});
//socket.On("alarm", (data) => //socket.On("alarm", (data) =>
//{ //{
// Console.WriteLine(data.ToString()); // Console.WriteLine(data.ToString());
//}); //});
//socket.On(Socket.EVENT_MESSAGE, (data) => //socket.On(Socket.EVENT_MESSAGE, (data) =>
//{ //{
// Console.WriteLine(data.ToString()); // Console.WriteLine(data.ToString());
//}); //});
//socket.On("urgent_alarm", (data) => //socket.On("urgent_alarm", (data) =>
//{ //{
// Console.WriteLine(data.ToString()); // Console.WriteLine(data.ToString());
//}); //});
//socket.On("clear_alarm", (data) => //socket.On("clear_alarm", (data) =>
//{ //{
// Console.WriteLine(data.ToString()); // 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.WriteLine("Started");
Console.ReadLine(); 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();}
}
}
} }