[BF] v.1.2.1.1 Next try to emulate F4G Events
This commit is contained in:
parent
5fa97ea82b
commit
c96b2393d3
@ -117,16 +117,38 @@ namespace ZwayBot.Moduls {
|
||||
}
|
||||
|
||||
private void RequestAlive() {
|
||||
String raspi = this.ini.GetValue("f4g", "raspi");
|
||||
lock (this.requestalivelock) {
|
||||
HttpWebRequest request = WebRequest.CreateHttp(this.ini.GetValue("f4g", "ping"));
|
||||
String req = "https://wiki.flex4grid.eu/rupdate/rupdate_general.yml.gpg.asc?gw=" + raspi;
|
||||
HttpWebRequest request = WebRequest.CreateHttp(req);
|
||||
try {
|
||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {}
|
||||
} catch(Exception) { }
|
||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
|
||||
this.Update?.Invoke(this, new Flex4gridEvent(req, response.StatusCode.ToString()));
|
||||
}
|
||||
} catch (Exception) { }
|
||||
}
|
||||
lock (this.requestalivelock) {
|
||||
String req = "https://wiki.flex4grid.eu/rupdate/rupdate_general.yml?gw=" + raspi;
|
||||
HttpWebRequest request = WebRequest.CreateHttp(req);
|
||||
try {
|
||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
|
||||
this.Update?.Invoke(this, new Flex4gridEvent(req, response.StatusCode.ToString()));
|
||||
}
|
||||
} catch (Exception) { }
|
||||
}
|
||||
lock (this.requestalivelock) {
|
||||
String req = "http://swb.pcs.flex4grid.eu/gateway/" + raspi;
|
||||
HttpWebRequest request = WebRequest.CreateHttp(req);
|
||||
try {
|
||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
|
||||
this.Update?.Invoke(this, new Flex4gridEvent(req, response.StatusCode.ToString()));
|
||||
}
|
||||
} catch (Exception) { }
|
||||
}
|
||||
}
|
||||
|
||||
public override void Interconnect(Dictionary<String, AModul> moduls) {
|
||||
if (this.ini.GetValue("f4g", "ping") != null) {
|
||||
if (this.ini.GetValue("f4g", "raspi") != null) {
|
||||
foreach (KeyValuePair<String, AModul> item in moduls) {
|
||||
if (item.Value is CronJob) {
|
||||
item.Value.SetInterconnection("10,40 * * * *", this.RequestAlive);
|
||||
|
@ -33,8 +33,8 @@ using System.Runtime.InteropServices;
|
||||
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.1.2.0")]
|
||||
[assembly: AssemblyFileVersion("1.1.2.0")]
|
||||
[assembly: AssemblyVersion("1.1.2.1")]
|
||||
[assembly: AssemblyFileVersion("1.1.2.1")]
|
||||
[assembly: NeutralResourcesLanguage("de-DE")]
|
||||
|
||||
// “Internet Of Things” icon by By Michael Wohlwend, US, from thenounproject.com.
|
||||
|
@ -58,6 +58,7 @@
|
||||
<Compile Include="Moduls\CronJob.cs" />
|
||||
<Compile Include="Helper.cs" />
|
||||
<Compile Include="Moduls\Flex4Grid.cs" />
|
||||
<Compile Include="Moduls\Mqtt.cs" />
|
||||
<Compile Include="Moduls\Overtaker.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user