mirror of
https://github.com/home-assistant/android
synced 2024-07-22 19:04:20 +00:00
Expose docs for websocket Matter/Thread functions (#3579)
This commit is contained in:
parent
5d1801cb01
commit
4c7549080b
|
@ -44,10 +44,38 @@ interface WebSocketRepository {
|
|||
suspend fun getTemplateUpdates(template: String): Flow<TemplateUpdatedEvent>?
|
||||
suspend fun getNotifications(): Flow<Map<String, Any>>?
|
||||
suspend fun ackNotification(confirmId: String): Boolean
|
||||
|
||||
/**
|
||||
* Request the server to add a Matter device to the network and commission it.
|
||||
* @return [MatterCommissionResponse] detailing the server's response, or `null` if the server
|
||||
* did not return a response.
|
||||
*/
|
||||
suspend fun commissionMatterDevice(code: String): MatterCommissionResponse?
|
||||
|
||||
/**
|
||||
* Request the server to commission a Matter device that is already on the network.
|
||||
* @return [MatterCommissionResponse] detailing the server's response, or `null` if the server
|
||||
* did not return a response.
|
||||
*/
|
||||
suspend fun commissionMatterDeviceOnNetwork(pin: Long): MatterCommissionResponse?
|
||||
|
||||
/**
|
||||
* Return a list of all Thread datasets known to the server.
|
||||
* @return List with [ThreadDatasetResponse]s, or `null` if not an admin or no response.
|
||||
*/
|
||||
suspend fun getThreadDatasets(): List<ThreadDatasetResponse>?
|
||||
|
||||
/**
|
||||
* Return the TLV value for a dataset.
|
||||
* @return [ThreadDatasetTlvResponse] for the Thread dataset, or `null` if not found, not an
|
||||
* admin or no response.
|
||||
*/
|
||||
suspend fun getThreadDatasetTlv(datasetId: String): ThreadDatasetTlvResponse?
|
||||
|
||||
/**
|
||||
* Add a new set of Thread network credentials to the server.
|
||||
* @return `true` if the server indicated success
|
||||
*/
|
||||
suspend fun addThreadDataset(tlv: ByteArray): Boolean
|
||||
|
||||
/**
|
||||
|
|
|
@ -370,11 +370,6 @@ class WebSocketRepositoryImpl @AssistedInject constructor(
|
|||
return response?.success == true
|
||||
}
|
||||
|
||||
/**
|
||||
* Request the server to add a Matter device to the network and commission it
|
||||
* @return [MatterCommissionResponse] detailing the server's response, or `null` if the server
|
||||
* did not return a response
|
||||
*/
|
||||
override suspend fun commissionMatterDevice(code: String): MatterCommissionResponse? {
|
||||
val response = sendMessage(
|
||||
WebSocketRequest(
|
||||
|
@ -400,11 +395,6 @@ class WebSocketRepositoryImpl @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Request the server to commission a Matter device that is already on the network
|
||||
* @return [MatterCommissionResponse] detailing the server's response, or `null` if the server
|
||||
* did not return a response
|
||||
*/
|
||||
override suspend fun commissionMatterDeviceOnNetwork(pin: Long): MatterCommissionResponse? {
|
||||
val response = sendMessage(
|
||||
WebSocketRequest(
|
||||
|
@ -430,10 +420,6 @@ class WebSocketRepositoryImpl @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of all Thread datasets known to the server.
|
||||
* @return List with [ThreadDatasetResponse]s, or `null` if not an admin or no response.
|
||||
*/
|
||||
override suspend fun getThreadDatasets(): List<ThreadDatasetResponse>? {
|
||||
val response = sendMessage(
|
||||
mapOf(
|
||||
|
@ -447,11 +433,6 @@ class WebSocketRepositoryImpl @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the TLV value for a dataset.
|
||||
* @return [ThreadDatasetTlvResponse] for the Thread dataset, or `null` if not found, not an
|
||||
* admin or no response.
|
||||
*/
|
||||
override suspend fun getThreadDatasetTlv(datasetId: String): ThreadDatasetTlvResponse? {
|
||||
val response = sendMessage(
|
||||
mapOf(
|
||||
|
@ -463,10 +444,6 @@ class WebSocketRepositoryImpl @AssistedInject constructor(
|
|||
return mapResponse(response)
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new set of Thread network credentials to the server.
|
||||
* @return `true` if the server indicated success
|
||||
*/
|
||||
override suspend fun addThreadDataset(tlv: ByteArray): Boolean {
|
||||
val response = sendMessage(
|
||||
mapOf(
|
||||
|
|
Loading…
Reference in a new issue