diff --git a/Zway/Devices/CommandClasses/Battery.cs b/Zway/Devices/CommandClasses/Battery.cs index 4b830dc..459fe8e 100644 --- a/Zway/Devices/CommandClasses/Battery.cs +++ b/Zway/Devices/CommandClasses/Battery.cs @@ -12,7 +12,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses { /// public class Battery : ACommandClass { - public Single Level { get; private set; } + public Double Level { get; private set; } public override event UpdatedValue Update; @@ -24,12 +24,12 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses { Boolean success = false; if (match.Groups[4].Value == ".data") { if (json.Keys.Contains("last") && json["last"].Keys.Contains("value")) { - this.Level = Single.Parse(json["last"]["value"].ToString()); + this.Level = Double.Parse(json["last"]["value"].ToString()); success = true; } } else if (match.Groups[4].Value == ".data.last") { if (json.Keys.Contains("value")) { - this.Level = Single.Parse(json["value"].ToString()); + this.Level = Double.Parse(json["value"].ToString()); success = true; } } else if (match.Groups[4].Value.StartsWith(".data.history.")) { @@ -44,7 +44,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses { private void InitComplex(JsonData json) { if (json.Keys.Contains("data") && json["data"].Keys.Contains("last") && json["data"]["last"].Keys.Contains("value")) { - this.Level = Single.Parse(json["data"]["last"]["value"].ToString()); + this.Level = Double.Parse(json["data"]["last"]["value"].ToString()); } } @@ -54,7 +54,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses { public override Dictionary ToDictionary() { return new Dictionary { - { "level", this.Level.ToString() }, + { "level", this.Level }, }; } } diff --git a/Zway/Devices/CommandClasses/CentralScene.cs b/Zway/Devices/CommandClasses/CentralScene.cs index c189899..8ab5db7 100644 --- a/Zway/Devices/CommandClasses/CentralScene.cs +++ b/Zway/Devices/CommandClasses/CentralScene.cs @@ -78,8 +78,8 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses { public override Dictionary ToDictionary() { return new Dictionary { - { "scene", this.Scene.ToString() }, - { "key", this.Key.ToString() }, + { "scene", this.Scene }, + { "key", this.Key }, }; } } diff --git a/Zway/Devices/CommandClasses/CommandClassSubs/Configurationsub.cs b/Zway/Devices/CommandClasses/CommandClassSubs/Configurationsub.cs index 89cc335..8c79ea4 100644 --- a/Zway/Devices/CommandClasses/CommandClassSubs/Configurationsub.cs +++ b/Zway/Devices/CommandClasses/CommandClassSubs/Configurationsub.cs @@ -61,8 +61,8 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs { public override Dictionary ToDictionary() { return new Dictionary { - { "level", this.Level.ToString() }, - { "size", this.Size.ToString() }, + { "level", this.Level }, + { "size", this.Size }, }; } } diff --git a/Zway/Devices/CommandClasses/CommandClassSubs/MeterSub.cs b/Zway/Devices/CommandClasses/CommandClassSubs/MeterSub.cs index 519fd90..5e96d75 100644 --- a/Zway/Devices/CommandClasses/CommandClassSubs/MeterSub.cs +++ b/Zway/Devices/CommandClasses/CommandClassSubs/MeterSub.cs @@ -11,7 +11,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs { public override event UpdatedValue Update; public String Type { get; private set; } - public Single Level { get; private set; } + public Double Level { get; private set; } public String Scale { get; private set; } public Metersub(JsonData json, Tuple id, HttpConnection http, Boolean polling) : base(json, id, http, polling) { this.HasReset = true; @@ -27,7 +27,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs { json.Keys.Contains("scaleString") && json["scaleString"].Keys.Contains("value")) { this.Type = json["sensorTypeString"]["value"].ToString(); - this.Level = Single.Parse(json["val"]["value"].ToString()); + this.Level = Double.Parse(json["val"]["value"].ToString()); this.Scale = json["scaleString"]["value"].ToString(); } } @@ -37,10 +37,10 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs { json.Keys.Contains("sensorTypeString") && json["sensorTypeString"].Keys.Contains("value") && json.Keys.Contains("scaleString") && json["scaleString"].Keys.Contains("value") && this.CheckSetUpdateTime(json)) { - this.Level = Single.Parse(json["val"]["value"].ToString()); + this.Level = Double.Parse(json["val"]["value"].ToString()); this.Type = json["sensorTypeString"]["value"].ToString(); this.Scale = json["scaleString"]["value"].ToString(); - this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple(this.Type, this.Scale, this.Level), this.LastUpdate, this)); + this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple(this.Type, this.Scale, this.Level), this.LastUpdate, this)); } } @@ -52,7 +52,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs { public override Dictionary ToDictionary() { return new Dictionary { - { "level", this.Level.ToString() }, + { "level", this.Level }, { "type", this.Type }, { "scale", this.Scale }, }; diff --git a/Zway/Devices/CommandClasses/CommandClassSubs/SensorMultilevelSub.cs b/Zway/Devices/CommandClasses/CommandClassSubs/SensorMultilevelSub.cs index a065352..de1104e 100644 --- a/Zway/Devices/CommandClasses/CommandClassSubs/SensorMultilevelSub.cs +++ b/Zway/Devices/CommandClasses/CommandClassSubs/SensorMultilevelSub.cs @@ -11,7 +11,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs { public override event UpdatedValue Update; public String Type { get; private set; } - public Single Level { get; private set; } + public Double Level { get; private set; } public String Scale { get; private set; } public Sensormultilevelsub(JsonData json, Tuple id, HttpConnection http, Boolean polling) : base(json, id, http, polling) { @@ -27,7 +27,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs { json.Keys.Contains("scaleString") && json["scaleString"].Keys.Contains("value")) { this.Type = json["sensorTypeString"]["value"].ToString(); - this.Level = Single.Parse(json["val"]["value"].ToString()); + this.Level = Double.Parse(json["val"]["value"].ToString()); this.Scale = json["scaleString"]["value"].ToString(); } } @@ -37,10 +37,10 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs { json.Keys.Contains("sensorTypeString") && json["sensorTypeString"].Keys.Contains("value") && json.Keys.Contains("scaleString") && json["scaleString"].Keys.Contains("value") && this.CheckSetUpdateTime(json)) { - this.Level = Single.Parse(json["val"]["value"].ToString()); + this.Level = Double.Parse(json["val"]["value"].ToString()); this.Type = json["sensorTypeString"]["value"].ToString(); this.Scale = json["scaleString"]["value"].ToString(); - this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple(this.Type, this.Scale, this.Level), this.LastUpdate, this)); + this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple(this.Type, this.Scale, this.Level), this.LastUpdate, this)); } } @@ -52,7 +52,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs { public override Dictionary ToDictionary() { return new Dictionary { - { "level", this.Level.ToString() }, + { "level", this.Level }, { "type", this.Type }, { "scale", this.Scale }, }; diff --git a/Zway/Devices/CommandClasses/CommandClassSubs/ThermostatSetPointSub.cs b/Zway/Devices/CommandClasses/CommandClassSubs/ThermostatSetPointSub.cs index dc87b7c..50d970d 100644 --- a/Zway/Devices/CommandClasses/CommandClassSubs/ThermostatSetPointSub.cs +++ b/Zway/Devices/CommandClasses/CommandClassSubs/ThermostatSetPointSub.cs @@ -10,20 +10,20 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs { class Thermostatsetpointsub : ACommandClass { public override event UpdatedValue Update; - private Single _level; - public Single Level { + private Double _level; + public Double Level { get { return this._level; } set { if (!this.HasMinMax || (this.HasMinMax && value >= this.TempMin && value <= this.TempMax)) { - this.SetTuple(this.SensorId, (Single)Math.Round(value * 2, MidpointRounding.AwayFromZero) / 2); + this.SetTuple(this.SensorId, (Double)Math.Round(value * 2, MidpointRounding.AwayFromZero) / 2); } } } public String Scale { get; private set; } - public Single TempMax { get; private set; } - public Single TempMin { get; private set; } + public Double TempMax { get; private set; } + public Double TempMin { get; private set; } public Boolean HasMinMax { get; private set; } public String Type { get; private set; } @@ -37,13 +37,13 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs { json.Keys.Contains("val") && json["val"].Keys.Contains("value") && json.Keys.Contains("deviceScaleString") && json["deviceScaleString"].Keys.Contains("value")) { this.Type = json["modeName"]["value"].ToString(); - this._level = Single.Parse(json["val"]["value"].ToString()); + this._level = Double.Parse(json["val"]["value"].ToString()); this.Scale = json["deviceScaleString"]["value"].ToString(); } if (json.Keys.Contains("min") && json["min"].Keys.Contains("value") && json.Keys.Contains("max") && json["max"].Keys.Contains("value")) { - this.TempMin = Single.Parse(json["min"]["value"].ToString()); - this.TempMax = Single.Parse(json["max"]["value"].ToString()); + this.TempMin = Double.Parse(json["min"]["value"].ToString()); + this.TempMax = Double.Parse(json["max"]["value"].ToString()); this.HasMinMax = true; } else { this.HasMinMax = false; @@ -55,22 +55,22 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs { if (json.Keys.Contains("val") && json["val"].Keys.Contains("value") && json.Keys.Contains("deviceScaleString") && json["deviceScaleString"].Keys.Contains("value") && json.Keys.Contains("modeName") && json["modeName"].Keys.Contains("value")) { - this._level = Single.Parse(json["val"]["value"].ToString()); + this._level = Double.Parse(json["val"]["value"].ToString()); this.Scale = json["deviceScaleString"]["value"].ToString(); this.Type = json["modeName"]["value"].ToString(); ret = true; } if (json.Keys.Contains("min") && json["val"].Keys.Contains("value") && json.Keys.Contains("max") && json["max"].Keys.Contains("value")) { - this.TempMin = Single.Parse(json["min"]["value"].ToString()); - this.TempMax = Single.Parse(json["max"]["value"].ToString()); + this.TempMin = Double.Parse(json["min"]["value"].ToString()); + this.TempMax = Double.Parse(json["max"]["value"].ToString()); this.HasMinMax = true; ret = true; } else { this.HasMinMax = false; } if (ret && this.CheckSetUpdateTime(json)) { - this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple(this.Type, this.Scale, this.Level, this.TempMin, this.TempMax, this.HasMinMax), this.LastUpdate, this)); + this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple(this.Type, this.Scale, this.Level, this.TempMin, this.TempMax, this.HasMinMax), this.LastUpdate, this)); } } @@ -82,12 +82,12 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs { public override Dictionary ToDictionary() { return new Dictionary { - { "level", this.Level.ToString() }, + { "level", this.Level }, { "type", this.Type }, { "scale", this.Scale }, - { "tempmax", this.TempMax.ToString() }, - { "tempmin", this.TempMin.ToString() }, - { "hasminmax", this.HasMinMax.ToString() }, + { "tempmax", this.TempMax }, + { "tempmin", this.TempMin }, + { "hasminmax", this.HasMinMax }, }; } } diff --git a/Zway/Devices/CommandClasses/Indicator.cs b/Zway/Devices/CommandClasses/Indicator.cs index 2746daa..f0444b2 100644 --- a/Zway/Devices/CommandClasses/Indicator.cs +++ b/Zway/Devices/CommandClasses/Indicator.cs @@ -50,7 +50,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses { public override Dictionary ToDictionary() { return new Dictionary { - { "level", this.Level.ToString() }, + { "level", this.Level }, }; } } diff --git a/Zway/Devices/CommandClasses/SwitchBinary.cs b/Zway/Devices/CommandClasses/SwitchBinary.cs index b3a2f04..f965b02 100644 --- a/Zway/Devices/CommandClasses/SwitchBinary.cs +++ b/Zway/Devices/CommandClasses/SwitchBinary.cs @@ -51,7 +51,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses { public override Dictionary ToDictionary() { return new Dictionary { - { "level", this.Level.ToString() } + { "level", this.Level } }; } } diff --git a/Zway/Devices/CommandClasses/SwitchMultilevel.cs b/Zway/Devices/CommandClasses/SwitchMultilevel.cs index e1d960b..c42caf4 100644 --- a/Zway/Devices/CommandClasses/SwitchMultilevel.cs +++ b/Zway/Devices/CommandClasses/SwitchMultilevel.cs @@ -54,7 +54,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses { public override Dictionary ToDictionary() { return new Dictionary { - { "level", this.Level.ToString() } + { "level", this.Level } }; } } diff --git a/Zway/Devices/CommandClasses/ThermostatMode.cs b/Zway/Devices/CommandClasses/ThermostatMode.cs index 4900a64..75cc9f4 100644 --- a/Zway/Devices/CommandClasses/ThermostatMode.cs +++ b/Zway/Devices/CommandClasses/ThermostatMode.cs @@ -71,7 +71,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses { modes.Add(item.Key.ToString(), item.Value); } Dictionary json = new Dictionary { - { "level", this.Level.ToString() }, + { "level", this.Level }, { "modes", modes } }; return json; diff --git a/Zway/Devices/CommandClasses/Wakeup.cs b/Zway/Devices/CommandClasses/Wakeup.cs index e7adb35..8f1b197 100644 --- a/Zway/Devices/CommandClasses/Wakeup.cs +++ b/Zway/Devices/CommandClasses/Wakeup.cs @@ -124,9 +124,11 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses { public override Dictionary ToDictionary() { return new Dictionary { - { "wakeupmin", this.WakeupMin.ToString() }, - { "wakeupmax", this.WakeupMax.ToString() }, - { "wakeupdefault", this.WakeupDefault.ToString() }, + {"interval", this.Interval }, + {"againstnode", this.AgainstNode }, + { "wakeupmin", this.WakeupMin }, + { "wakeupmax", this.WakeupMax }, + { "wakeupdefault", this.WakeupDefault }, { "lastwakeup", this.LastWakeup.ToString() }, { "lastsleep", this.LastSleep.ToString() } }; diff --git a/Zway/Events/DeviceUpdateEvent.cs b/Zway/Events/DeviceUpdateEvent.cs index a586143..a743e0e 100644 --- a/Zway/Events/DeviceUpdateEvent.cs +++ b/Zway/Events/DeviceUpdateEvent.cs @@ -10,8 +10,8 @@ namespace BlubbFish.IoT.Zway.Events { public DeviceUpdateEvent() { } - public DeviceUpdateEvent(Single value, DateTime time, Object parent) { - this.GetSingle = value; + public DeviceUpdateEvent(Double value, DateTime time, Object parent) { + this.GetDouble = value; this.UpdateTime = time; this.Parent = parent; } @@ -28,13 +28,13 @@ namespace BlubbFish.IoT.Zway.Events { this.Parent = parent; } - public DeviceUpdateEvent(Tuple value, DateTime time, Object parent) { - this.GetStringStringSingleTuple = value; + public DeviceUpdateEvent(Tuple value, DateTime time, Object parent) { + this.GetStringStringDoubleTuple = value; this.UpdateTime = time; this.Parent = parent; } - public DeviceUpdateEvent(Tuple value, DateTime time, Object parent) { - this.GetStringStringSingleSingleSingleSingleBooleanTuple = value; + public DeviceUpdateEvent(Tuple value, DateTime time, Object parent) { + this.GetStringStringDoubleDoubleDoubleDoubleBooleanTuple = value; this.UpdateTime = time; this.Parent = parent; } @@ -51,10 +51,10 @@ namespace BlubbFish.IoT.Zway.Events { this.Parent = parent; } - public Single GetSingle { get; } + public Double GetDouble { get; } public DateTime GetDate { get; } - public Tuple GetStringStringSingleTuple { get; } - public Tuple GetStringStringSingleSingleSingleSingleBooleanTuple { get; } + public Tuple GetStringStringDoubleTuple { get; } + public Tuple GetStringStringDoubleDoubleDoubleDoubleBooleanTuple { get; } public Tuple GetLongIntegerTuple { get; } public DateTime UpdateTime { get; } public Object Parent { get; private set; } diff --git a/Zway/Interfaces/ACommandClass.cs b/Zway/Interfaces/ACommandClass.cs index f1a765d..771cd30 100644 --- a/Zway/Interfaces/ACommandClass.cs +++ b/Zway/Interfaces/ACommandClass.cs @@ -172,11 +172,11 @@ namespace BlubbFish.IoT.Zway.Interfaces { this.http.GetVoid("ZWave.zway/Run/devices[" + this.DeviceId + "].instances[" + this.Instance + "].commandClasses[" + ((Int32)this.Commandclass).ToString() + "].Set(" + value + ")"); } - protected void SetTuple(Single value1, Single value2) { + protected void SetTuple(Double value1, Double value2) { this.http.GetVoid("ZWave.zway/Run/devices[" + this.DeviceId + "].instances[" + this.Instance + "].commandClasses[" + ((Int32)this.Commandclass).ToString() + "].Set(" + value1 + "," + value2 + ")"); } - protected void SetTuple(Int32 v1, Int32 v2) => this.SetTuple(v1, (Single)v2); + protected void SetTuple(Int32 v1, Int32 v2) => this.SetTuple(v1, (Double)v2); protected Boolean CheckSetUpdateTime(JsonData json) { if (json.Keys.Contains("updateTime") && (json["updateTime"].IsInt || json["updateTime"].IsLong)) { diff --git a/Zway/Properties/AssemblyInfo.cs b/Zway/Properties/AssemblyInfo.cs index e00e39e..39af2ff 100644 --- a/Zway/Properties/AssemblyInfo.cs +++ b/Zway/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] +[assembly: AssemblyVersion("1.3.1.0")] +[assembly: AssemblyFileVersion("1.3.1.0")] diff --git a/Zway/bin/Release/Zway.dll b/Zway/bin/Release/Zway.dll index 2489e42..607e2b3 100644 Binary files a/Zway/bin/Release/Zway.dll and b/Zway/bin/Release/Zway.dll differ