예제 #1
0
파일: Device.cs 프로젝트: Mavtak/roomie
 protected Device(Network network, DeviceType type = null)
 {
     Network = network;
     Location = new Location();
     Type = type ?? DeviceType.Unknown;
     Name = null;
     IsConnected = null;
     CurrentStateGenerator = new CurrentStateGenerator();
 }
예제 #2
0
파일: Device.cs 프로젝트: Mavtak/roomie
        public Device(string address, DateTime? lastPing, int id, string name, Network network, IScriptRepository scripts, IDeviceState state, ITaskRepository tasks, DeviceType type)
            : this()
        {
            Address = address;
            LastPing = lastPing;
            Id = id;
            Name = name;
            Network = network;
            ScriptRepository = scripts;
            TaskRepository = tasks;
            Type = type;

            if (state != null)
            {
                Update(state, false);
            }
        }
예제 #3
0
 public ReadOnlyDeviceState(string name, string address, ILocation location, INetwork network, bool? isConnected, DeviceType type, string currentAction, IBinarySwitchState toggleSwitchState, IMultilevelSwitchState dimmerSwitchState, IColorSwitchState colorSwitchState, IBinarySensorState binarySensorState, IMultilevelSensorState<IPower> powerSensorState, IMultilevelSensorState<ITemperature> temperatureSensorState, IMultilevelSensorState<IHumidity> humiditySensorState, IMultilevelSensorState<IIlluminance> illuminanceSensorState, IThermostatState thermostatState, IKeypadState keypadState)
 {
     Name = name;
     Address = address;
     Location = location;
     NetworkState = network;
     IsConnected = isConnected;
     Type = type;
     CurrentAction = currentAction;
     BinarySwitchState = toggleSwitchState;
     MultilevelSwitchState = dimmerSwitchState;
     ColorSwitchState = colorSwitchState;
     BinarySensorState = binarySensorState;
     PowerSensorState = powerSensorState;
     TemperatureSensorState = temperatureSensorState;
     HumiditySensorState = humiditySensorState;
     IlluminanceSensorState = illuminanceSensorState;
     ThermostatState = thermostatState;
     KeypadState = keypadState;
 }
예제 #4
0
파일: Device.cs 프로젝트: Mavtak/roomie
        public static Device Create(string address, bool? isConnected, string name, Network network, ILocation location, DeviceType type, string currentAction = null)
        {
            var result = new Device(
                address: address,
                lastPing: null,
                id: 0,
                name: name,
                network: network,
                scripts: null,
                state: null,
                tasks: null,
                type: type
                );

            result.CurrentAction = currentAction;

            return result;
        }
예제 #5
0
파일: DeviceType.cs 프로젝트: Mavtak/roomie
        public bool Equals(DeviceType that)
        {
            if (that == null)
            {
                return false;
            }

            var one = GetTypeFromString(Name);
            var two = GetTypeFromString(that.Name);

            return one == two;
        }