internal async Task <Uri> GetVodStream(string cameraId, string videoId) { Uri vodStreamUri; if (GetCamera(cameraId, out Uri vpnUri)) { Uri firstLocalUrl = await APICommands.Ping(vpnUri).ConfigureAwait(false); Uri secondLocalUrl = await APICommands.Ping(firstLocalUrl).ConfigureAwait(false); if (firstLocalUrl == secondLocalUrl) { UriBuilder uriBuilder = new UriBuilder(vpnUri); uriBuilder.Path += VodPath + videoId + LocalStream; vodStreamUri = uriBuilder.Uri; } else { UriBuilder uriBuilder = new UriBuilder(vpnUri); uriBuilder.Path += VodPath + videoId + DistantStream; vodStreamUri = uriBuilder.Uri; } } else { UriBuilder uriBuilder = new UriBuilder(vpnUri); uriBuilder.Path += VodPath + videoId + DistantStream; vodStreamUri = uriBuilder.Uri; } return(vodStreamUri); }
internal WeatherDevice(APICommands aPICommands) { Base = new Base(aPICommands); OutdoorModule = new OutdoorModule(aPICommands); IndoorModule1 = new IndoorModule(aPICommands); IndoorModule2 = new IndoorModule(aPICommands); IndoorModule3 = new IndoorModule(aPICommands); Anemometer = new Anemometer(aPICommands); RainGauge = new RainGauge(aPICommands); }
/// <summary> /// Create a new manager for a user. /// </summary> /// <param name="applicationId"> Your application ID (more information at <see href="https://dev.netatmo.com/myaccount/createanapp"/>).</param> /// <param name="applicationSecret">Your application Secret (more information at <see href="https://dev.netatmo.com/myaccount/createanapp"/>).</param> /// <param name="username">Netatmo account username</param> /// <param name="password">Netatmo account password</param> public NetatmoManager(string applicationId, string applicationSecret, string username, string password) { _APICommands = new APICommands { ApplicationId = applicationId, ApplicationSecret = applicationSecret, Username = username, Password = password, Scope = "read_station read_thermostat write_thermostat read_camera write_camera access_camera read_presence access_presence read_homecoach read_smokedetector" }; WeatherStation = new WeatherStation(_APICommands); EnergyStation = new EnergyStation(_APICommands); SecurityStation = new SecurityStation(_APICommands); }
internal ExtraDevice(APICommands aPICommands) : base(aPICommands) { }
internal Base(APICommands aPICommands) : base(aPICommands) { }
internal IndoorModule(APICommands aPICommands) : base(aPICommands) { }
internal Anemometer(APICommands aPICommands) : base(aPICommands) { }
internal WeatherStation(APICommands aPICommands) { _aPICommands = aPICommands; }
internal CommonWeatherDevice(APICommands aPICommands) { _aPICommands = aPICommands; }
internal RainGauge(APICommands aPICommands) : base(aPICommands) { }
internal SecurityStation(APICommands aPICommands) { _aPICommands = aPICommands; }
internal EnergyStation(APICommands aPICommands) { _aPICommands = aPICommands; }
internal EnergyDevice(APICommands aPICommands) { Relay = new Relay(); }