Kleine Fehler behoben
This commit is contained in:
		
							parent
							
								
									27f12d5bae
								
							
						
					
					
						commit
						ef55750312
					
				@ -1,20 +1,20 @@
 | 
				
			|||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Globalization;
 | 
					using System.Globalization;
 | 
				
			||||||
using System.Text;
 | 
					using Dashboard.Connector;
 | 
				
			||||||
using uPLibrary.Networking.M2Mqtt.Messages;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Dashboard.Sensor {
 | 
					namespace Dashboard.Sensor {
 | 
				
			||||||
  class Luminanz : ASensor {
 | 
					  class Luminanz : ASensor {
 | 
				
			||||||
    public Luminanz(Dictionary<String, String> settings) : base(settings) {
 | 
					    public Luminanz(Dictionary<String, String> settings, String name, ADataBackend backend) : base(settings, name, backend) {
 | 
				
			||||||
      this.GetBool = true;
 | 
					      this.GetBool = true;
 | 
				
			||||||
      this.GetFloat = 0.0f;
 | 
					      this.GetFloat = 0.0f;
 | 
				
			||||||
      this.GetInt = 0;
 | 
					      this.GetInt = 0;
 | 
				
			||||||
      this.Datatypes = Types.Int;
 | 
					      this.Datatypes = Types.Int;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override void UpdateValue(MqttMsgPublishEventArgs e) {
 | 
					    protected override Boolean UpdateValue(MqttEventArgs e) {
 | 
				
			||||||
      this.GetInt = Int32.Parse(Encoding.UTF8.GetString(e.Message), new CultureInfo("en-US"));
 | 
					      this.GetInt = Int32.Parse(e.Message, new CultureInfo("en-US"));
 | 
				
			||||||
 | 
					      return true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -1,16 +1,16 @@
 | 
				
			|||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Text;
 | 
					using Dashboard.Connector;
 | 
				
			||||||
using uPLibrary.Networking.M2Mqtt.Messages;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Dashboard.Sensor {
 | 
					namespace Dashboard.Sensor {
 | 
				
			||||||
  class Pir : ASensor {
 | 
					  class Pir : ASensor {
 | 
				
			||||||
    public Pir(Dictionary<String, String> settings) : base(settings) {
 | 
					    public Pir(Dictionary<String, String> settings, String name, ADataBackend backend) : base(settings, name, backend) {
 | 
				
			||||||
      this.Datatypes = Types.Bool;
 | 
					      this.Datatypes = Types.Bool;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override void UpdateValue(MqttMsgPublishEventArgs e) {
 | 
					    protected override Boolean UpdateValue(MqttEventArgs e) {
 | 
				
			||||||
      this.GetBool = (Encoding.UTF8.GetString(e.Message).ToLower() == "on") ? true : false;
 | 
					      this.GetBool = (e.Message.ToLower() == "on") ? true : false;
 | 
				
			||||||
 | 
					      return true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -1,20 +1,20 @@
 | 
				
			|||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Globalization;
 | 
					using System.Globalization;
 | 
				
			||||||
using System.Text;
 | 
					using Dashboard.Connector;
 | 
				
			||||||
using uPLibrary.Networking.M2Mqtt.Messages;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Dashboard.Sensor {
 | 
					namespace Dashboard.Sensor {
 | 
				
			||||||
  class Temperatur : ASensor {
 | 
					  class Temperatur : ASensor {
 | 
				
			||||||
    public Temperatur(Dictionary<String, String> settings) : base(settings) {
 | 
					    public Temperatur(Dictionary<String, String> settings, String name, ADataBackend backend) : base(settings, name, backend) {
 | 
				
			||||||
      this.GetBool = true;
 | 
					      this.GetBool = true;
 | 
				
			||||||
      this.GetFloat = 0.0f;
 | 
					      this.GetFloat = 0.0f;
 | 
				
			||||||
      this.GetInt = 0;
 | 
					      this.GetInt = 0;
 | 
				
			||||||
      this.Datatypes = Types.Float;
 | 
					      this.Datatypes = Types.Float;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected override void UpdateValue(MqttMsgPublishEventArgs e) {
 | 
					    protected override Boolean UpdateValue(MqttEventArgs e) {
 | 
				
			||||||
      this.GetFloat = Single.Parse(Encoding.UTF8.GetString(e.Message), new CultureInfo("en-US"));
 | 
					      this.GetFloat = Single.Parse(e.Message, new CultureInfo("en-US"));
 | 
				
			||||||
 | 
					      return true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user