Exemple #1
0
        public async Task UpdateThingShadow(ThingShadow <T> thingShadow)
        {
            var updateThingShadowRequest = new UpdateThingShadowRequest()
            {
                ThingName = this.thingName,
                Payload   = Utils.ToJsonMemoryStream(thingShadow)
            };

            var result = await this.client.UpdateThingShadowAsync(updateThingShadowRequest);

            if (result.HttpStatusCode != HttpStatusCode.OK)
            {
                throw new ThingShadowUpdateFailedException($"Received HTTP {result.HttpStatusCode}");
            }
        }
Exemple #2
0
 private static void SwitchOff(ThingShadow <ChristmasTreeState> thingShadow)
 {
     thingShadow.State.Desired.Animation = ChristmasTreeState.AnimationOff;
 }
Exemple #3
0
 private static void CycleAnimationState(ThingShadow <ChristmasTreeState> thingShadow)
 {
     thingShadow.State.Desired.Animation = thingShadow.State.Reported.NextAnimationState();
 }