Example #1
0
 public Notification(string address = null, HAInterface iface = null, List <StateDevice> devices = null, List <Behaviors.BehaviorBase> behaviors = null,
                     string subject = null, string message    = null) :
     base(address: address, iface: iface, devices: devices, behaviors: behaviors)
 {
     Subject = subject;
     Message = message;
     IntrinsicBehaviors();
 }
Example #2
0
 public Light(string address = null, HAInterface iface = null, StateDevice restrictionDevice = null, StateType restrictionState = null, CommandType idleCommandPrimary = null, string idleCommandSecondary = null, int idleTimeSecs = 0, List <StateDevice> devices = null, List <Behaviors.BehaviorBase> behaviors = null) :
     base(address: address, iface: iface, devices: devices, behaviors: behaviors)
 {
     RestrictionDevice    = restrictionDevice;
     RestrictionState     = restrictionState;
     IdleCommandPrimary   = idleCommandPrimary;
     IdleCommandSecondary = idleCommandSecondary;
     IdleTimeSecs         = idleTimeSecs;
     IntrinsicBehaviors();
 }
Example #3
0
 public void SetUp()
 {
     _data   = null;
     _action = null;
     _t      = new Netomity.Interfaces.Basic.Fakes.StubBasicInterface()
     {
         SendString        = (data) => { _data = data; },
         DataReceivedEvent = (ev) => { _t._DataReceived(ev); },
     };
     _ha = new Netomity.Interfaces.HA.Fakes.StubHAInterface(iface: _t)
     {
         CommandCommand = (command) => { _command = command; return(new Task <bool>(() => { return true; })); },
         OnCommandStringActionOfCommand = (address, action) => {
             _action = action;
         }
     };
     _sd = new StateDevice(iface: _ha, address: _address);
 }
Example #4
0
        public void SetUp()
        {
            _data = null;
            _t    = new Netomity.Interfaces.Basic.Fakes.StubBasicInterface()
            {
                SendString        = (data) => { _data = data; },
                DataReceivedEvent = (ev) => { _t._DataReceived(ev); },
            };

            _ha = new HAInterface(iface: _t);
            _sp = new SendParams()
            {
                SendData        = "asdf",
                SuccessResponse = "asdfgood",
                FailureResponse = "asdfbad",
                Timeout         = 1,
            };
        }
Example #5
0
        public StateDevice(string address = null, HAInterface iface = null, List <StateDevice> devices = null, List <BehaviorBase> behaviors = null)
        {
            _iface            = iface;
            Address           = address;
            _commandDelegates = new List <Action <Command> >();
            _stateDelegates   = new List <Action <State> >();
            _behaviors        = new List <BehaviorBase>();

            _state = new State()
            {
                Primary = StateType.Unknown
            };

            _Initialize();

            RegisterDevices(devices);
            RegisterBehaviors(behaviors);

            if (_iface != null)
            {
                _iface.OnCommand(source: Address, action: _CommandReceived);
            }
        }
Example #6
0
 public Scene(string address = null, HAInterface iface = null, List <StateDevice> devices = null) :
     base(address: address, iface: iface, devices: devices)
 {
 }
Example #7
0
 public Motion(string address = null, HAInterface iface = null, List <StateDevice> devices = null, List <Behaviors.BehaviorBase> behaviors = null) :
     base(address: address, iface: iface, devices: devices, behaviors: behaviors)
 {
     IntrinsicBehaviors();
 }
Example #8
0
 public Door(string address = null, HAInterface iface = null, List <StateDevice> devices = null, List <Behaviors.BehaviorBase> behaviors = null, bool isInverted = false) :
     base(address: address, iface: iface, devices: devices, behaviors: behaviors)
 {
     IsInverted = isInverted;
     IntrinsicBehaviors();
 }