/// <summary> /// Gets all Devices by it's Sub Type (e.g. E-Charging Station) /// </summary> /// <param name="accessToken">The OAuth2 access token</param> /// <param name="meterSubType">The MeterSubType by which to filter</param> /// <param name="resultHandler">The result handler</param> /// <returns></returns> public static async Task <IActionResult> GetDevicesAsync( string accessToken, MeterSubType meterSubType, ResultHandler <List <Device> > resultHandler) { using (var restApi = new SmartMeApiClient(accessToken)) { return(await restApi.GetAsync <List <Device> >( "DevicesBySubType", new Dictionary <string, object> { { "meterSubType", Enum.GetName(typeof(MeterSubType), meterSubType) } }, resultHandler )); } }
/// <summary> /// Gets all Devices by it's Sub Type (e.g. E-Charging Station) /// </summary> /// <param name="usernamePassword">The Username and Password for Basic Authentication</param> /// <param name="meterSubType">The MeterSubType by which to filter</param> /// <returns></returns> public static async Task <List <Device> > GetDevicesAsync(UserPassword usernamePassword, MeterSubType meterSubType) { using (var restApi = new SmartMeApiClient(usernamePassword)) { return(await restApi.GetAsync <List <Device> >("DevicesBySubType", new Dictionary <string, object> { { "meterSubType", Enum.GetName(typeof(MeterSubType), meterSubType) } })); } }