Ejemplo n.º 1
0
 /// <summary>
 /// Stops the specified device.
 /// </summary>
 /// <param name="device">The device.</param>
 /// <returns></returns>
 public bool Stop(EchoDevice device)
 {
     if (Login())
     {
         var result = Post <MediaStatePayload>(new MediaStatePayload {
             DeviceSerialNumber = device.SerialNumber,
             DeviceType         = device.Type,
             NewMediaVolume     = null
         }, Urls.SET_MEDIA_STATE_FORMAT.With(MediaStates.STOP));
         return(result != null);
     }
     return(false);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Mutes the specified device.
 /// </summary>
 /// <param name="device">The device.</param>
 /// <returns></returns>
 public bool Mute(EchoDevice device)
 {
     if (Login())
     {
         var options = Options(Urls.SET_MEDIA_STATE_FORMAT.With(MediaStates.VOLUME));
         if (options == HttpStatusCode.OK)
         {
             var result = Post <MediaStatePayload>(new MediaStatePayload {
                 DeviceSerialNumber = device.SerialNumber,
                 DeviceType         = device.Type,
                 NewMediaVolume     = 0
             }, Urls.SET_MEDIA_STATE_FORMAT.With(MediaStates.VOLUME));
             return(result != null);
         }
     }
     return(false);
 }