[NF] Zway-Bot hinzugefügt
[NF] Viele kleine Änderungen an Zwaylib zur Verbesserung der Kompatibilität
This commit is contained in:
@@ -3,10 +3,14 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.RegularExpressions;
|
||||
using BlubbFish.IoT.Zway.Events;
|
||||
using BlubbFish.IoT.Zway.Interfaces;
|
||||
using BlubbFish.IoT.Zway.lib;
|
||||
using LitJson;
|
||||
|
||||
namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
||||
/// <summary>
|
||||
/// 91 = CentralScene
|
||||
/// </summary>
|
||||
public class Centralscene : CommandClass {
|
||||
public override event UpdatedValue Update;
|
||||
|
||||
@@ -14,7 +18,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
||||
public Int32 Scene { get; private set; }
|
||||
public Int32 Key { get; private set; }
|
||||
|
||||
public Centralscene(JsonData json, HttpConnection http, Tuple<Int32, Int32, Int32> id) : base(json, http, id) {
|
||||
public Centralscene(JsonData json, HttpConnection http, Tuple<Int32, Int32, Int32> id, Boolean polling) : base(json, http, id, polling) {
|
||||
this.ValidScenesModes = new ReadOnlyDictionary<Int32, ReadOnlyCollection<Int32>>(new Dictionary<Int32, ReadOnlyCollection<Int32>>());
|
||||
this.InitComplex(json);
|
||||
}
|
||||
@@ -30,11 +34,11 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
||||
this.Update?.Invoke(this, new DeviceUpdateEvent(new Tuple<Int32, Int32>(this.Scene, this.Key), this.LastUpdate));
|
||||
}
|
||||
} else {
|
||||
throw new NotImplementedException();
|
||||
Helper.WriteError("Kenne in " + this.Name + " [" + this.Id + "] " + match.Groups[4].Value + " nicht!");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void InitComplex(JsonData json) {
|
||||
private void InitComplex(JsonData json) {
|
||||
if (json.Keys.Contains("data")) {
|
||||
JsonData data = json["data"];
|
||||
if(data.Keys.Contains("sceneSupportedKeyAttributesMask")) {
|
||||
@@ -67,7 +71,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
|
||||
}
|
||||
|
||||
public override String ToString() {
|
||||
return "CentralScene " + this.Name + ": "+this.Scene+"-"+this.Key;
|
||||
return "CentralScene " + this.Name + " [" + this.Id + "]: " + this.Scene+"-"+this.Key;
|
||||
}
|
||||
|
||||
internal override void Poll() {
|
||||
|
||||
Reference in New Issue
Block a user