protected InsteonDevice FindDevice(string deviceId) { InsteonAddress address; if (InsteonAddress.TryParse(deviceId, out address)) { if (Manager.Network.Devices.ContainsKey(address)) { var device = Manager.Network.Devices.Find(address); return(device); } throw HttpError.NotFound("Device does not exist or is not linked."); } throw HttpError.NotFound("Device does not exist or is not linked."); }
private bool TryParserAddress(string addressText, out InsteonAddress address) { return(InsteonAddress.TryParse(addressText, out address)); }