Add new Class and throw on exeption

This commit is contained in:
BlubbFish 2018-08-02 21:42:26 +00:00
parent 3a19253230
commit c47895e6bb
5 changed files with 9 additions and 8 deletions

View File

@ -8,7 +8,7 @@ using LitJson;
namespace BlubbFish.IoT.Zway.Devices { namespace BlubbFish.IoT.Zway.Devices {
public class Device { public class Device {
private Boolean polling; private readonly Boolean polling;
public delegate void UpdatedDevice(Object sender, DeviceUpdateEvent e); public delegate void UpdatedDevice(Object sender, DeviceUpdateEvent e);
public event UpdatedDevice Update; public event UpdatedDevice Update;

View File

@ -24,6 +24,7 @@ namespace BlubbFish.IoT.Zway.Interfaces {
MeterPulse = 53, MeterPulse = 53,
MeterTableMonitor = 61, MeterTableMonitor = 61,
ThermostatOperatingState = 66, ThermostatOperatingState = 66,
ClimateControlSchedule = 70,
CRC16 = 86, CRC16 = 86,
AssociationGroupInformation = 89, AssociationGroupInformation = 89,
DeviceResetLocally = 90, DeviceResetLocally = 90,

View File

@ -16,7 +16,7 @@ namespace BlubbFish.IoT.Zway {
private Thread updatethread; private Thread updatethread;
private Thread pollthread; private Thread pollthread;
public static ReadOnlyDictionary<String, String> namelist; public static ReadOnlyDictionary<String, String> namelist;
private Boolean polling; private readonly Boolean polling;
public delegate void DataUpdate(Object sender, DeviceUpdateEvent e); public delegate void DataUpdate(Object sender, DeviceUpdateEvent e);
public event DataUpdate Update; public event DataUpdate Update;

Binary file not shown.

View File

@ -6,9 +6,9 @@ using LitJson;
namespace BlubbFish.IoT.Zway.lib { namespace BlubbFish.IoT.Zway.lib {
public class HttpConnection { public class HttpConnection {
private String auth; private readonly String auth;
private String server; private readonly String server;
private Object getLock = new Object(); private readonly Object getLock = new Object();
internal HttpConnection(String server, String user, String pass) { internal HttpConnection(String server, String user, String pass) {
this.auth = "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(user + ":" + pass)); this.auth = "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(user + ":" + pass));
@ -54,9 +54,9 @@ namespace BlubbFish.IoT.Zway.lib {
} }
} }
} catch (Exception e) { } catch (Exception e) {
Helper.WriteError("Konnte keine Verbindung zum Razzbery Server herstellen. Resource: \"" + this.server + v + "\" Fehler: " + e.Message); //Helper.WriteError("Konnte keine Verbindung zum Razzbery Server herstellen. Resource: \"" + this.server + v + "\" Fehler: " + e.Message);
return null; //return null;
//throw new Exceptions.ConnectionException("Konnte keine Verbindung zum Razzbery Server herstellen: " + e.Message); throw new Exceptions.ConnectionException("Konnte keine Verbindung zum Razzbery Server herstellen: " + e.Message);
} }
} }
return ret; return ret;