Пример #1
0
        protected internal override void HandleEvent(Command command)
        {
            base.HandleEvent(command);

            var report = new BatteryReport(Node, command.Payload);

            OnChanged(new ReportEventArgs <BatteryReport>(report));
        }
Пример #2
0
        void ReceiveBatteryReport(ZWave.CommandClasses.BatteryReport report)
        {
            var r = new Report <BatteryReport>
            {
                Timestamp = DateTime.UtcNow,
                Data      = new BatteryReport
                {
                    IsLow = report.IsLow,
                    Value = report.Value
                }
            };

            var state = nodeStates[report.Node.NodeID];

            state.BatteryReport = r;
        }