getPosition method
override
Get the current position (int) of the Switch.
var position = await mySwitch.getPosition();
For more information, see Switch component.
Implementation
@override
Future<int> getPosition({Map<String, dynamic>? extra}) async {
final request = GetPositionRequest()
..name = name
..extra = extra?.toStruct() ?? Struct();
final response = await client.getPosition(request);
return response.position;
}