コード例 #1
0
        public override void execCommand(eCommandType cmdType, Function function)
        {
            if (checkCommandType(cmdType))
            {
                LogHelper.Log(LogLevel.Info, String.Format(">>> Execute SendNuvoCommand command on event {0}", cmdType));
                LogHelper.Log(LogLevel.Trace, String.Format("      SendNuvoCommand={0} / Function={1}", _sendNuvoCommand.ToString(), function.ToString()));

                // Send Nuvo command ...
                if (_zoneServer != null)
                {
                    ZoneState newState = new ZoneState();
                    newState.Source      = _sendNuvoCommand.SourceId;
                    newState.PowerStatus = _sendNuvoCommand.PowerStatus;
                    if (_sendNuvoCommand.Volume >= 0)
                    {
                        newState.Volume = _sendNuvoCommand.Volume;
                    }
                    _zoneServer.SetZoneState(_sendNuvoCommand.ZoneId, newState);
                }
                else
                {
                    LogHelper.Log(LogLevel.Error, String.Format("      Execute SendNuvoCommand FAILED!"));
                }
            }
        }
コード例 #2
0
 /// <summary>
 /// <see cref=">IMonitorAndControl"/>
 /// </summary>
 /// <param name="zoneId"></param>
 /// <param name="stateCommand"></param>
 public void SetZoneState(Address zoneId, ZoneState stateCommand)
 {
     _log.Trace(m => m(String.Format("M&C: SetZoneState: Address={0}, Command={1}", zoneId.ToString(), stateCommand.ToString())));
     _zoneServer.SetZoneState(zoneId, stateCommand);
 }