MethodChannelTuyaFlutterHaSdk class
The MethodChannel implementation of TuyaFlutterHaSdkPlatform.
- Inheritance
-
- Object
- PlatformInterface
- TuyaFlutterHaSdkPlatform
- MethodChannelTuyaFlutterHaSdk
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- methodChannel → MethodChannel
-
The MethodChannel used to talk to the native side.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addDeviceToRoom(
{required int homeId, required int roomId, required String devId}) → Future< void> -
Add a given device to a room
homeId,roomId,devIddetails are passed on to native addDeviceToRoom function of native is invokedoverride -
addGroupToRoom(
{required int homeId, required int roomId, required int groupId}) → Future< void> -
Add a group to a given room
homeId,roomId,groupIddetails are passed on to native addGroupToRoom function of native is invokedoverride -
addRoom(
{required int homeId, required String roomName}) → Future< void> -
Add a room to a home
homeId,roomNamedetails is passed on to native addRoom function of native is invokedoverride -
checkIfMatter(
{required String devId}) → Future< bool> -
Check if a device is matter device or not
devIddetails is passed on to native checkIfMatter function of native is invokedoverride -
checkLogin(
) → Future< bool> -
Checks if any user is logged in currently.
checkLogin function on the native side is invoked
returns true if logged in and false if not logged in
override
-
connectDeviceAndQueryWifiList(
{required int timeout}) → Future< void> -
Connects to device AP and queries Wi-Fi networks (AP+ flow).
timeoutdata is passed on to nativeoverride -
controlMatter(
{required String devId, required Map< String, dynamic> dps}) → Future<void> -
Send dps configuration to control the wifi device
devId,dpsdetails are passed on to native controlMatter function of native is invokedoverride -
createHome(
{required String name, String? geoName, List< String> ? rooms, double? latitude, double? longitude}) → Future<int> -
Creates a new home.
name,geoName,rooms,latitude,longitudedetails are passed on to the native createHome function of the native is invoked Returns the new home ID.override -
deleteAccount(
) → Future< void> -
Deletes the current user account.
deleteAccount function on the native side is invoked
override
-
deleteHome(
{required int homeId}) → Future< void> -
Deletes a home by ID.
homeIdis passed on to the native deleteHome function of native is invokedoverride -
discoverDeviceInfo(
) → Future< Map< String, dynamic> ?> -
Scans for the first inactivated BLE device advertising Tuya packets.
discoverDeviceInfo function in native is invoked
Returns its raw JSON map, or null if none found.
override
-
dynamicWifiLockPassword(
{required String devId}) → Future< String> -
Get a dynamic password for opening a wifi lock
devIddetails is passed on to native dynamicWifiLockPassword function of native is invokedoverride -
getCurrentUser(
) → Future< Map< String, dynamic> > -
Get the current user’s info. Throws if no user is logged in.
getCurrentUser function on the native side is invoked
returns a map with all the user details
override
-
getHomeDevices(
{required int homeId}) → Future< List< Map< >String, dynamic> > -
Gets all devices for the given homeId.
homeIdis passed on to the native getHomeDevices function of native is invoked returns the list of devicesoverride -
getHomeList(
) → Future< List< Map< >String, dynamic> > -
Retrieves a list of all homes.
getHomeList function of the native is invoked
returns the list of homes
override
-
getPlatformVersion(
) → Future< String?> -
Returns the platform version, e.g. "iOS 18.5" or "Android 12".
override
-
getRoomList(
{required int homeId}) → Future< List< Map< ?>String, dynamic> > -
Get rooms details for a home
homeIdis passed on to native getRoomList function of native is invoked returns JSON mapoverride -
getSSID(
) → Future< String?> -
Retrieves the current Wi-Fi SSID
getSSID function of the native is invoked
returns the ssid
override
-
getToken(
{required int homeId}) → Future< String?> -
Retrieves a pairing token for the given homeId.
homeIdis passed on to native getToken function of the native is invoked token of the home is returnedoverride -
initDevice(
{required String devId}) → Future< void> -
Init the device
devIdis passed on to native initDevice function on native is invokedoverride -
lockBLELock(
{required String devId}) → Future< void> -
Lock a bluetooth lock device
devIddetails is passed on to native lockBLELock function of native is invokedoverride -
loginWithUid(
{required String countryCode, required String uid, required String password, required bool createHome}) → Future< Map< String, dynamic> > -
Login (or register) with UID.
countryCode,uid,password,createHomedetails are passed on to the native loginWithUid function on the native side is invokedoverride -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pairBleDevice(
{required String uuid, required String productId, required int homeId, int? deviceType, String? address, int? flag, int? timeout}) → Future< Map< String, dynamic> ?> -
Activate (pair) a pure-BLE device with the cloud.
uuid,productId,homeId,deviceType,addressdetails is passed on to native pairBleDevice function on native is invoked Returns a JSON mapoverride -
queryDeviceInfo(
{required String devId, List< String> ? dps}) → Future<Map< String, dynamic> ?> -
Query information about a device
devId,dpsdetails are passed on to native queryDeviceInfo function of native is invokedoverride -
queryDeviceWiFiStrength(
{required String devId}) → Future< String?> -
Get the signal strength of a specific device
devIdis passed on to native queryDeviceWifiStrength function of native is invoked String is returnedoverride -
querySubDeviceList(
{required String devId}) → Future< Map< String, dynamic> ?> -
Query details of any sub devices
devIdis passed on to native querySubDeviceList function of native is invoked returns a JSON mapoverride -
removeDevice(
{required String devId}) → Future< void> -
Remove a specific device
devIdis passed on to native removeDevice function of native is invokedoverride -
removeDeviceFromRoom(
{required int homeId, required int roomId, required String devId}) → Future< void> -
Remove device from a given room
homeId,roomId,devIddetails are passed on to native removeDeviceFromRoom function on native is invokedoverride -
removeGroupFromRoom(
{required int homeId, required int roomId, required int groupId}) → Future< void> -
Remove a group from a given room
homeId,roomId,groupIddetails are passed on to native removeGroupFromRoom function of native is invokedoverride -
removeRoom(
{required int homeId, required int roomId}) → Future< void> -
Remove room from a home
homeId,roomIddetails are passed on to native removeRoom function of native is invokedoverride -
renameDevice(
{required String devId, required String name}) → Future< void> -
Rename a specific device
devId,namedetails are passed on to native renameDevice function of native is invokedoverride -
restoreFactoryDefaults(
{required String devId}) → Future< void> -
Restore factory defaults for a specific device
devIdis passed on to native restoreFactoryDefaults function of native is invokedoverride -
resumeAPPlus(
{required String ssid, required String password, required String token, required int timeout}) → Future< void> -
Completes AP+ pairing with SSID/password/token.
ssid,password,token,timeoutdetails are passed on to native resumeAPPlus function in native is invokedoverride -
sortRooms(
{required int homeId, required List< int> roomIds}) → Future<void> -
Sort the order of rooms in a home
homeId,roomIdsdetails are passed on to native sortRooms function of native is invokedoverride -
startComboPairing(
{required String uuid, required String productId, required int homeId, required String ssid, required String password, int? timeout, int? deviceType, String? address, String? token, int? flag}) → Future< Map< String, dynamic> ?> -
Start combo (BLE→Wi-Fi) pairing for a device.
uuid,productId,homeId,ssid,password,timeout,deviceType,address,tokendetails is passed on to native startComboPairing function of native is invoked returns a JSON mapoverride -
startConfigWiFi(
{required String mode, required String ssid, required String password, required String token, required int timeout}) → Future< void> -
Starts EZ or AP Wi-Fi pairing.
mode,ssid,password,token,timeoutdetails are passed on to native startConfigWifi function of native is invokedoverride -
stopConfigWiFi(
) → Future< void> -
Stops any ongoing Wi-Fi pairing.
stopConfigWifi function on native is invoked
override
-
toString(
) → String -
A string representation of this object.
inherited
-
tuyaSdkInit(
{required String appKey, required String appSecret, required bool isDebug}) → Future< void> -
Perform native-side initialization of the Tuya SDK.
appKeyandappSecretmust match the current platform. tuyaSdkInit function in the native code (Java/Swift) is calledoverride -
unlockBLELock(
{required String devId}) → Future< void> -
Unlock a bluetooth lock device
devIddetails is passed on to native unlockBLELock function of native is invokedoverride -
unlockWifiLock(
{required String devId, required bool open}) → Future< void> -
Reply to a unlock request on wifi lock
devId,opendetails are passed on to native unlockWifiLock function of native is invokedoverride -
updateHomeInfo(
{required int homeId, required String homeName, String? geoName, double? latitude, double? longitude}) → Future< void> -
Updates home information.
homeId,homeName,geoName,latitude,longitudedetails are passed on to the native updateHomeInfo function of native is invokedoverride -
updateLocation(
{required double latitude, required double longitude}) → Future< void> -
Updates the user’s location
latitude,longitudeis passed on native updateLocation function on native is invokcedoverride -
updateNickname(
{required String nickname}) → Future< void> -
Updates the current user’s nickname.
nicknameis passed on to the native updateNickname function of the native is invokedoverride -
updateRoomName(
{required int homeId, required int roomId, required String roomName}) → Future< void> -
Update the name of a given room
homeId,roomId,roomNamedetails are passed on to native updateRoomName function of native is invokedoverride -
updateTempUnit(
{required int tempUnit}) → Future< void> -
Changes the user’s temperature unit preference.
tempUnitis passed on to the native updateTempUnit function of the native is invokedoverride -
updateTimeZone(
{required String timeZoneId}) → Future< void> -
Updates the user’s time zone.
timeZoneIdis passed on to the native updateTimeZone function of the native is invokedoverride -
userLogout(
) → Future< void> -
Logs out the current logged in user
userLogout function on the native side is invoked
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited