protected internal override void HandleEvent(Command command) { base.HandleEvent(command); var report = new SensorMultiLevelReport(Node, command.Payload); OnChanged(new ReportEventArgs<SensorMultiLevelReport>(report)); }
void ReceiveSensorMultiLevelReport(ZWave.CommandClasses.SensorMultiLevelReport report) { var r = new Report <SensorMultiLevelReport> { Timestamp = DateTime.UtcNow, Data = new SensorMultiLevelReport { Type = report.Type, Value = report.Value, Unit = report.Unit, Scale = report.Scale } }; var state = nodeStates[report.Node.NodeID]; switch (report.Type) { case SensorType.Temperature: state.TemperatureReport = r; break; case SensorType.RelativeHumidity: state.RelativeHumidityReport = r; break; case SensorType.Luminance: state.LuminanceReport = r; break; } }
protected internal override void HandleEvent(Command command) { base.HandleEvent(command); var report = new SensorMultiLevelReport(Node, command.Payload); OnChanged(new ReportEventArgs <SensorMultiLevelReport>(report)); }
private void HandleSensorMultiLevelReport(SensorMultiLevelReport report) { var variable = report.Type + "Sensor"; UpdateVariable(report, variable, (double)report.Value); UpdateVariable(report, variable + "Unit", report.Unit); }