private String createApplianceDataRequestUrl(BaseAppliance appliance, DateTime?from, DateTime?to)
        {
            if (from == null ||
                to == null)
            {
                return(String.Format(getApiClient().apiPath() + APPLIANCE_DATA_URL_TEMPLATE,
                                     appliance.getRoom().getLocation().getId(),
                                     appliance.getRoom().getId(),
                                     appliance.getApplianceId()));
            }

            return(String.Format(getApiClient().apiPath() + APPLIANCE_DATA_WITH_RANGE_URL_TEMPLATE,
                                 appliance.getRoom().getLocation().getId(),
                                 appliance.getRoom().getId(),
                                 appliance.getApplianceId(),
                                 createOndusDateString(from.Value),
                                 createOndusDateString(to.Value)));
        }
        public ApplianceStatus getApplianceStatus(BaseAppliance appliance)
        {
            ApiResponse <ApplianceStatus.ApplianceStatusModel[]> applianceApiResponse = getApiClient()
                                                                                        .get <ApplianceStatus.ApplianceStatusModel[]>(String.Format(getApiClient().apiPath() + APPLIANCE_STATUS_URL_TEMPLATE,
                                                                                                                                                    appliance.getRoom().getLocation().getId(),
                                                                                                                                                    appliance.getRoom().getId(),
                                                                                                                                                    appliance.getApplianceId()
                                                                                                                                                    ));

            if (applianceApiResponse.getStatusCode() != 200)
            {
                return(null);
            }

            ApplianceStatus.ApplianceStatusModel[] applianceStatusesOptional = applianceApiResponse.getContent();
            ApplianceStatus applianceStatusOptional = null;

            if (applianceStatusesOptional != null)
            {
                ApplianceStatus.ApplianceStatusModel[] applianceStatuses = applianceStatusesOptional;
                ApplianceStatus applianceStatus = new ApplianceStatus(appliance, applianceStatuses);
                applianceStatusOptional = applianceStatus;
            }

            return(applianceStatusOptional);
        }