public bool EditDevice(string _roomName, string _deviceName, DeviceData _device) { if (rooms.ContainsKey(_roomName)) { return rooms[_roomName].EditDevice(_deviceName, _device); } return false; }
public bool AddNewDevice(string _roomName, DeviceData _device) { if (rooms.ContainsKey(_roomName)) { return rooms[_roomName].AddNewDevice(_device); } return false; }
public bool EditDevice(string _deviceName, DeviceData _device) { if (devices.ContainsKey(_deviceName)) { devices.Remove(_deviceName); devices.Add(_device.DeviceName, _device); return true; } return false; }
public bool AddNewDevice(DeviceData _device) { if (devices.ContainsKey(_device.DeviceName)) { return false; } devices.Add(_device.DeviceName, new DeviceData(_device.DeviceName, _device.PinGPIO, _device.KeySpeech, _device.StateCurrent, _device.UsingSensor, _device.PinSensor)); return true; }
public string AddNewDevice() { string _deviceName = "My Device"; if (devices.ContainsKey(_deviceName)) { _deviceName = this.CreateName(); } DeviceData device = new DeviceData(_deviceName); devices.Add(_deviceName, device); return _deviceName; }
public void Read(XmlNodeList xnList) { DeviceData device = null; foreach (XmlNode xn in xnList) { device = new DeviceData(xn.Attributes["name"].Value); device.Read(xn); devices.Add(device.DeviceName, device); } }