示例#1
0
        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);
 }
示例#3
0
 /// <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)
 {
 }
示例#5
0
 internal Base(APICommands aPICommands) : base(aPICommands)
 {
 }
示例#6
0
 internal IndoorModule(APICommands aPICommands) : base(aPICommands)
 {
 }
示例#7
0
 internal Anemometer(APICommands aPICommands) : base(aPICommands)
 {
 }
示例#8
0
 internal WeatherStation(APICommands aPICommands)
 {
     _aPICommands = aPICommands;
 }
 internal CommonWeatherDevice(APICommands aPICommands)
 {
     _aPICommands = aPICommands;
 }
示例#10
0
 internal RainGauge(APICommands aPICommands) : base(aPICommands)
 {
 }
示例#11
0
 internal SecurityStation(APICommands aPICommands)
 {
     _aPICommands = aPICommands;
 }
示例#12
0
 internal EnergyStation(APICommands aPICommands)
 {
     _aPICommands = aPICommands;
 }
 internal EnergyDevice(APICommands aPICommands)
 {
     Relay = new Relay();
 }