public GetDevicesMessage GetDevices() { var response = PimaticRestClient.PerformHttpGet("/api/devices"); var devices = JsonConvert.DeserializeObject <GetDevicesMessage>(GetResultMessage(response)); if (!devices.devices.Any() || devices.devices == null) { throw new PimaticException("E_PIM_SVC.003", "No devices found"); } return(devices); }
public GetDeviceByIdMessage GetDeviceById(string deviceId) { var response = PimaticRestClient.PerformHttpGet("/api/devices/" + deviceId); var device = JsonConvert.DeserializeObject <GetDeviceByIdMessage>(GetResultMessage(response)); if (device != null) { if (device.device == null) { throw new PimaticException("E_PIM_SVC.005", "Device could not be found for deviceId {0}", deviceId); } } return(device); }
public GetPageByIdMessage GetPageById(string pageId) { var response = PimaticRestClient.PerformHttpGet("/api/pages/" + pageId); var getPageByIdMessage = JsonConvert.DeserializeObject <GetPageByIdMessage>(GetResultMessage(response)); if (getPageByIdMessage != null) { if (getPageByIdMessage.page == null) { throw new PimaticException("E_PIM_SVC.004", "Page for pageId {0} could not be captured", pageId); } } return(getPageByIdMessage); }
public GetVariablesMessage GetVariables() { var response = PimaticRestClient.PerformHttpGet("/api/variables"); return(JsonConvert.DeserializeObject <GetVariablesMessage>(GetResultMessage(response))); }
public GetDeviceClassConfigSchemaMessage GetDeviceClassConfigSchema(string className) { var response = PimaticRestClient.PerformHttpGet("/api/device-class/" + className); return(JsonConvert.DeserializeObject <GetDeviceClassConfigSchemaMessage>(GetResultMessage(response))); }
public GetGuiSettingsMessage GetGuiSetttings() { var response = PimaticRestClient.PerformHttpGet("/api/config/settings/gui"); return(JsonConvert.DeserializeObject <GetGuiSettingsMessage>(GetResultMessage(response))); }
public GetConfigMessage GetConfig() { var response = PimaticRestClient.PerformHttpGet("/api/config?password=" + PimaticSettings.Password); return(JsonConvert.DeserializeObject <GetConfigMessage>(GetResultMessage(response))); }