[NF] Now possible to emulate F4G
This commit is contained in:
parent
53e4ba9d14
commit
06e57c4559
@ -37,7 +37,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
|||||||
Helper.WriteError("Kenne in "+this.Name+" ["+this.Id+"] "+ match.Groups[4].Value+" nicht!");
|
Helper.WriteError("Kenne in "+this.Name+" ["+this.Id+"] "+ match.Groups[4].Value+" nicht!");
|
||||||
}
|
}
|
||||||
if (success && this.CheckSetUpdateTime(json)) {
|
if (success && this.CheckSetUpdateTime(json)) {
|
||||||
this.Update?.Invoke(this, new DeviceUpdateEvent(this.Level, this.LastUpdate));
|
this.Update?.Invoke(this, new DeviceUpdateEvent(this.Level, this.LastUpdate, this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
|||||||
} else if (match.Groups[4].Value == ".data.keyAttribute") {
|
} else if (match.Groups[4].Value == ".data.keyAttribute") {
|
||||||
if (json.Keys.Contains("value") && this.CheckSetUpdateTime(json)) {
|
if (json.Keys.Contains("value") && this.CheckSetUpdateTime(json)) {
|
||||||
this.Key = Int32.Parse(json["value"].ToString());
|
this.Key = Int32.Parse(json["value"].ToString());
|
||||||
this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple<Int32, Int32>(this.Scene, this.Key), this.LastUpdate));
|
this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple<Int32, Int32>(this.Scene, this.Key), this.LastUpdate, this));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Helper.WriteError("Kenne in " + this.Name + " [" + this.Id + "] " + match.Groups[4].Value + " nicht!");
|
Helper.WriteError("Kenne in " + this.Name + " [" + this.Id + "] " + match.Groups[4].Value + " nicht!");
|
||||||
|
@ -54,7 +54,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs {
|
|||||||
this.CheckSetUpdateTime(json)) {
|
this.CheckSetUpdateTime(json)) {
|
||||||
this._level = Int64.Parse(json["val"]["value"].ToString());
|
this._level = Int64.Parse(json["val"]["value"].ToString());
|
||||||
this.Size = Int32.Parse(json["size"]["value"].ToString());
|
this.Size = Int32.Parse(json["size"]["value"].ToString());
|
||||||
this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple<Int64, Int32>(this.Level, this.Size), this.LastUpdate));
|
this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple<Int64, Int32>(this.Level, this.Size), this.LastUpdate, this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs {
|
|||||||
this.Level = Single.Parse(json["val"]["value"].ToString());
|
this.Level = Single.Parse(json["val"]["value"].ToString());
|
||||||
this.Type = json["sensorTypeString"]["value"].ToString();
|
this.Type = json["sensorTypeString"]["value"].ToString();
|
||||||
this.Scale = json["scaleString"]["value"].ToString();
|
this.Scale = json["scaleString"]["value"].ToString();
|
||||||
this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple<String, String, Single>(this.Type, this.Scale, this.Level), this.LastUpdate));
|
this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple<String, String, Single>(this.Type, this.Scale, this.Level), this.LastUpdate, this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs {
|
|||||||
this.Level = Single.Parse(json["val"]["value"].ToString());
|
this.Level = Single.Parse(json["val"]["value"].ToString());
|
||||||
this.Type = json["sensorTypeString"]["value"].ToString();
|
this.Type = json["sensorTypeString"]["value"].ToString();
|
||||||
this.Scale = json["scaleString"]["value"].ToString();
|
this.Scale = json["scaleString"]["value"].ToString();
|
||||||
this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple<String, String, Single>(this.Type, this.Scale, this.Level), this.LastUpdate));
|
this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple<String, String, Single>(this.Type, this.Scale, this.Level), this.LastUpdate, this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs {
|
|||||||
this.HasMinMax = false;
|
this.HasMinMax = false;
|
||||||
}
|
}
|
||||||
if (ret && this.CheckSetUpdateTime(json)) {
|
if (ret && this.CheckSetUpdateTime(json)) {
|
||||||
this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple<String, String, Single, Single, Single, Boolean>(this.Type, this.Scale, this.Level, this.TempMin, this.TempMax, this.HasMinMax), this.LastUpdate));
|
this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple<String, String, Single, Single, Single, Boolean>(this.Type, this.Scale, this.Level, this.TempMin, this.TempMax, this.HasMinMax), this.LastUpdate, this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void DeviceUpdate(Object sender, DeviceUpdateEvent e) {
|
private void DeviceUpdate(Object sender, DeviceUpdateEvent e) {
|
||||||
this.Update?.Invoke(sender, e);
|
this.Update?.Invoke(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitComplex(JsonData json) {
|
private void InitComplex(JsonData json) {
|
||||||
|
@ -36,7 +36,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
|||||||
if(match.Groups[4].Value == ".data.stat") {
|
if(match.Groups[4].Value == ".data.stat") {
|
||||||
if (json.Keys.Contains("value") && this.CheckSetUpdateTime(json)) {
|
if (json.Keys.Contains("value") && this.CheckSetUpdateTime(json)) {
|
||||||
this._level = Int32.Parse(json["value"].ToString()) == 255;
|
this._level = Int32.Parse(json["value"].ToString()) == 255;
|
||||||
this.Update?.Invoke(this, new DeviceUpdateEvent(this.Level, this.LastUpdate));
|
this.Update?.Invoke(this, new DeviceUpdateEvent(this.Level, this.LastUpdate, this));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Helper.WriteError("Kenne in " + this.Name + " [" + this.Id + "] " + match.Groups[4].Value + " nicht!");
|
Helper.WriteError("Kenne in " + this.Name + " [" + this.Id + "] " + match.Groups[4].Value + " nicht!");
|
||||||
|
@ -26,7 +26,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void DeviceUpdate(Object sender, DeviceUpdateEvent e) {
|
private void DeviceUpdate(Object sender, DeviceUpdateEvent e) {
|
||||||
this.Update?.Invoke(sender, e);
|
this.Update?.Invoke(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal override void SetUpdate(JsonData json, Match match) {
|
internal override void SetUpdate(JsonData json, Match match) {
|
||||||
|
@ -26,7 +26,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void DeviceUpdate(Object sender, DeviceUpdateEvent e) {
|
private void DeviceUpdate(Object sender, DeviceUpdateEvent e) {
|
||||||
this.Update?.Invoke(sender, e);
|
this.Update?.Invoke(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal override void SetUpdate(JsonData json, Match match) {
|
internal override void SetUpdate(JsonData json, Match match) {
|
||||||
|
@ -31,7 +31,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
|||||||
if(match.Groups[4].Value == ".data.level") {
|
if(match.Groups[4].Value == ".data.level") {
|
||||||
if (json.Keys.Contains("value") && json["value"].IsBoolean && this.CheckSetUpdateTime(json)) {
|
if (json.Keys.Contains("value") && json["value"].IsBoolean && this.CheckSetUpdateTime(json)) {
|
||||||
this._level = (Boolean)json["value"];
|
this._level = (Boolean)json["value"];
|
||||||
this.Update?.Invoke(this, new DeviceUpdateEvent(this.Level, this.LastUpdate));
|
this.Update?.Invoke(this, new DeviceUpdateEvent(this.Level, this.LastUpdate, this));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Helper.WriteError("Kenne in " + this.Name + " [" + this.Id + "] " + match.Groups[4].Value + " nicht!");
|
Helper.WriteError("Kenne in " + this.Name + " [" + this.Id + "] " + match.Groups[4].Value + " nicht!");
|
||||||
|
@ -33,7 +33,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
|||||||
if(match.Groups[4].Value == ".data.level") {
|
if(match.Groups[4].Value == ".data.level") {
|
||||||
if(json.Keys.Contains("value") && this.CheckSetUpdateTime(json)) {
|
if(json.Keys.Contains("value") && this.CheckSetUpdateTime(json)) {
|
||||||
this._level = Int32.Parse(json["value"].ToString());
|
this._level = Int32.Parse(json["value"].ToString());
|
||||||
this.Update?.Invoke(this, new DeviceUpdateEvent(this.Level, this.LastUpdate));
|
this.Update?.Invoke(this, new DeviceUpdateEvent(this.Level, this.LastUpdate, this));
|
||||||
}
|
}
|
||||||
} else if (match.Groups[4].Value == ".data.prevLevel") {
|
} else if (match.Groups[4].Value == ".data.prevLevel") {
|
||||||
} else {
|
} else {
|
||||||
|
@ -35,7 +35,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
|||||||
if(match.Groups[4].Value == ".data.mode") {
|
if(match.Groups[4].Value == ".data.mode") {
|
||||||
if(json.Keys.Contains("value") && this.CheckSetUpdateTime(json)) {
|
if(json.Keys.Contains("value") && this.CheckSetUpdateTime(json)) {
|
||||||
this._level = Int32.Parse(json["value"].ToString());
|
this._level = Int32.Parse(json["value"].ToString());
|
||||||
this.Update?.Invoke(this, new DeviceUpdateEvent(this.Level, this.LastUpdate));
|
this.Update?.Invoke(this, new DeviceUpdateEvent(this.Level, this.LastUpdate, this));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Helper.WriteError("Kenne in " + this.Name + " [" + this.Id + "] " + match.Groups[4].Value + " nicht!");
|
Helper.WriteError("Kenne in " + this.Name + " [" + this.Id + "] " + match.Groups[4].Value + " nicht!");
|
||||||
|
@ -25,7 +25,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void DeviceUpdate(Object sender, DeviceUpdateEvent e) {
|
private void DeviceUpdate(Object sender, DeviceUpdateEvent e) {
|
||||||
this.Update?.Invoke(sender, e);
|
this.Update?.Invoke(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal override void SetUpdate(JsonData json, Match match) {
|
internal override void SetUpdate(JsonData json, Match match) {
|
||||||
|
@ -113,7 +113,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
|||||||
Helper.WriteError("Kenne in " + this.Name + " [" + this.Id + "] " + match.Groups[4].Value + " nicht!");
|
Helper.WriteError("Kenne in " + this.Name + " [" + this.Id + "] " + match.Groups[4].Value + " nicht!");
|
||||||
}
|
}
|
||||||
if (success && this.CheckSetUpdateTime(json)) {
|
if (success && this.CheckSetUpdateTime(json)) {
|
||||||
this.Update?.Invoke(this, new DeviceUpdateEvent(0, this.LastUpdate));
|
this.Update?.Invoke(this, new DeviceUpdateEvent(0, this.LastUpdate, this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ namespace BlubbFish.IoT.Zway.Devices {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void InstanceUpdate(Object sender, DeviceUpdateEvent e) {
|
private void InstanceUpdate(Object sender, DeviceUpdateEvent e) {
|
||||||
this.Update?.Invoke(sender, e);
|
this.Update?.Invoke(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateInstances(JsonData json, HttpConnection http) {
|
private void CreateInstances(JsonData json, HttpConnection http) {
|
||||||
|
@ -38,7 +38,7 @@ namespace BlubbFish.IoT.Zway.Devices {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void ClassUpdate(Object sender, DeviceUpdateEvent e) {
|
private void ClassUpdate(Object sender, DeviceUpdateEvent e) {
|
||||||
this.Update?.Invoke(sender, e);
|
this.Update?.Invoke(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateInstances(JsonData json, HttpConnection http) {
|
private void CreateInstances(JsonData json, HttpConnection http) {
|
||||||
|
@ -10,38 +10,45 @@ namespace BlubbFish.IoT.Zway.Events {
|
|||||||
public DeviceUpdateEvent() {
|
public DeviceUpdateEvent() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeviceUpdateEvent(Single value, DateTime time) {
|
public DeviceUpdateEvent(Single value, DateTime time, Object parent) {
|
||||||
this.GetSingle = value;
|
this.GetSingle = value;
|
||||||
this.UpdateTime = time;
|
this.UpdateTime = time;
|
||||||
|
this.Parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeviceUpdateEvent(Boolean value, DateTime time) {
|
public DeviceUpdateEvent(Boolean value, DateTime time, Object parent) {
|
||||||
this.GetBoolean = value;
|
this.GetBoolean = value;
|
||||||
this.UpdateTime = time;
|
this.UpdateTime = time;
|
||||||
|
this.Parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeviceUpdateEvent(DateTime value, DateTime time) {
|
public DeviceUpdateEvent(DateTime value, DateTime time, Object parent) {
|
||||||
this.GetDate = value;
|
this.GetDate = value;
|
||||||
this.UpdateTime = time;
|
this.UpdateTime = time;
|
||||||
|
this.Parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeviceUpdateEvent(Tuple<String, String, Single> value, DateTime time) {
|
public DeviceUpdateEvent(Tuple<String, String, Single> value, DateTime time, Object parent) {
|
||||||
this.GetStringStringSingleTuple = value;
|
this.GetStringStringSingleTuple = value;
|
||||||
this.UpdateTime = time;
|
this.UpdateTime = time;
|
||||||
|
this.Parent = parent;
|
||||||
}
|
}
|
||||||
public DeviceUpdateEvent(Tuple<String, String, Single, Single, Single, Boolean> value, DateTime time) {
|
public DeviceUpdateEvent(Tuple<String, String, Single, Single, Single, Boolean> value, DateTime time, Object parent) {
|
||||||
this.GetStringStringSingleSingleSingleSingleBooleanTuple = value;
|
this.GetStringStringSingleSingleSingleSingleBooleanTuple = value;
|
||||||
this.UpdateTime = time;
|
this.UpdateTime = time;
|
||||||
|
this.Parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeviceUpdateEvent(Tuple<Int32, Int32> value, DateTime time) {
|
public DeviceUpdateEvent(Tuple<Int32, Int32> value, DateTime time, Object parent) {
|
||||||
this.GetIntegerTuple = value;
|
this.GetIntegerTuple = value;
|
||||||
this.UpdateTime = time;
|
this.UpdateTime = time;
|
||||||
|
this.Parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeviceUpdateEvent(Tuple<Int64, Int32> value, DateTime time) {
|
public DeviceUpdateEvent(Tuple<Int64, Int32> value, DateTime time, Object parent) {
|
||||||
this.GetLongIntegerTuple = value;
|
this.GetLongIntegerTuple = value;
|
||||||
this.UpdateTime = time;
|
this.UpdateTime = time;
|
||||||
|
this.Parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Single GetSingle { get; }
|
public Single GetSingle { get; }
|
||||||
@ -50,6 +57,7 @@ namespace BlubbFish.IoT.Zway.Events {
|
|||||||
public Tuple<String, String, Single, Single, Single, Boolean> GetStringStringSingleSingleSingleSingleBooleanTuple { get; }
|
public Tuple<String, String, Single, Single, Single, Boolean> GetStringStringSingleSingleSingleSingleBooleanTuple { get; }
|
||||||
public Tuple<Int64, Int32> GetLongIntegerTuple { get; }
|
public Tuple<Int64, Int32> GetLongIntegerTuple { get; }
|
||||||
public DateTime UpdateTime { get; }
|
public DateTime UpdateTime { get; }
|
||||||
|
public Object Parent { get; private set; }
|
||||||
public Boolean GetBoolean { get; }
|
public Boolean GetBoolean { get; }
|
||||||
public Tuple<Int32,Int32> GetIntegerTuple { get; }
|
public Tuple<Int32,Int32> GetIntegerTuple { get; }
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user