---
title: "changeToMode(with:completion:)"
framework: matter
role: symbol
role_heading: Instance Method
path: "matter/mtrbaseclusterdeviceenergymanagementmode/changetomode(with:completion:)"
---

# changeToMode(with:completion:)

Command ChangeToMode

## Declaration

```swift
func changeToMode(with params: MTRDeviceEnergyManagementModeClusterChangeToModeParams, completion: @escaping @Sendable (MTRDeviceEnergyManagementModeClusterChangeToModeResponseParams?, (any Error)?) -> Void)
```

```swift
func changeToMode(with params: MTRDeviceEnergyManagementModeClusterChangeToModeParams) async throws -> MTRDeviceEnergyManagementModeClusterChangeToModeResponseParams
```

## Discussion

Discussion This command is used to change device modes.
