完成web和app权限交换
This commit is contained in:
@@ -63,12 +63,22 @@ class RemoteControlRepositoryImpl implements RemoteControlRepository {
|
||||
@override
|
||||
Future<bool> requestControlPermission( String deviceName, String deviceId) async {
|
||||
try {
|
||||
await _remoteTcp.sendSwitchControlRequest(deviceName);
|
||||
debugPrint('🔑 [RemoteControl] TCP已发送权限请求 (0x04)');
|
||||
_remoteTcp.sendSwitchControlRequest(deviceName);
|
||||
debugPrint('🔑 [RemoteControl] TCP已发送权限请求');
|
||||
return await _remoteHttp.requestRemoteControlViaHttp(deviceName, deviceId);
|
||||
} catch (e) {
|
||||
debugPrint('❌ [RemoteControl] 权限请求失败:$e');
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void respondPermission(bool bool, String deviceId) {
|
||||
// TODO: implement respondPermission
|
||||
if (bool) {
|
||||
_remoteTcp.sendSwitchControlResponse(true, deviceId);
|
||||
} else {
|
||||
_remoteTcp.sendSwitchControlResponse(false, deviceId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user