public void DoorInteraction(DoorState doorstate) { if (CurrentDoorstate == doorstate) { return; } CurrentDoorstate = doorstate; CabinaDeDusController.Play(doorstate.ToString()); }
private void UpdateUi(DoorState doorState) { switch (doorState) { case SamsungWatchGarage.Integration.Models.DoorState.opening: case SamsungWatchGarage.Integration.Models.DoorState.closing: button.BackgroundColor = Color.Brown; button.Text = doorState.ToString(); button.IsEnabled = false; break; case SamsungWatchGarage.Integration.Models.DoorState.open: button.BackgroundColor = Color.Red; button.IsEnabled = true; button.Text = "Close"; break; case SamsungWatchGarage.Integration.Models.DoorState.closed: button.BackgroundColor = Color.Green; button.IsEnabled = true; button.Text = "Open"; break; } }
private async Task SaveDoorStateAsync(string vehicleId, DoorKind kind, DoorState state, CancellationToken cancellation) { string key = MakeCacheKey(vehicleId, kind); var stateStr = state.ToString().ToLowerInvariant(); await cache.SetStringAsync(key, stateStr, cancellation); }