Exemple #1
0
        protected Task Handle(SerialResultEvent serialResultCommand)
        {
            var system = serialResultCommand.AsByte("System");
            var code   = serialResultCommand.AsUint("Code");

            return(MessageBroker.Publish(InfraredEvent.Create(Uid, system, code), Uid));
        }
Exemple #2
0
        protected async Task Handle(SerialResultEvent serialResultCommand)
        {
            var code          = serialResultCommand.AsUint("Code");
            var dipswitchCode = DipswitchCode.ParseCode(code);

            if (dipswitchCode == null)
            {
                Logger.LogWarning($"Unrecognized command parsed from code {code}");
                return;
            }

            await MessageBroker.Publish(DipswitchEvent.Create(Uid, dipswitchCode.Unit.ToString(), dipswitchCode.System.ToString(), dipswitchCode.Command.ToString()), Uid);
        }