Entwicklung/Sensormat/ESP8266_Gaszaehler/ESP8266_Gaszaehler.cs

39 lines
1.2 KiB
C#
Raw Normal View History

2025-09-23 10:21:23 +02:00
// Decompiled with JetBrains decompiler
// Type: Sensormat.ESP8266_Gaszaehler.ESP8266_Gaszaehler
// Assembly: ESP8266_Gaszaehler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 4783B34D-C78D-4F6E-946E-4E4DC92855C4
// Assembly location: \\192.168.178.26\Freigabe\ESP8266_Gaszaehler.dll
using Newtonsoft.Json;
using Sensormat.Entities;
using System;
#nullable disable
namespace Sensormat.ESP8266_Gaszaehler
{
public class ESP8266_Gaszaehler : ISensor
{
public override bool Execute()
{
try
{
int id = this.Sensor.ID;
new ResultSet().XMLSerializeData<ResultSet>();
string str = this.HttpRequest(this.Sensor.URL);
if (str != null)
{
this.LastValue = JsonConvert.DeserializeObject<ResultSet>(str).GasMeter;
this.LastValueDate = new DateTime?(DateTime.Now);
return true;
}
}
catch (Exception ex)
{
Console.WriteLine((object)ex);
this.ErrorMsg = ex.Message;
}
return false;
}
}
}