apidocs / com.nimmsta.core.android.accessibilityservice / WebCommunicator

WebCommunicator

object WebCommunicator : NIMMSTAEventHandler, DeviceListUpdateDelegate

This object handles the communication with webpages that have an input element with the id "nimmsta-output-element" If the input field contains text this class processes the text and sends the required commands to the HS 50

Properties

NIMMSTA_INPUT_ID

const val NIMMSTA_INPUT_ID: String

NIMMSTA_OUTPUT_ID

const val NIMMSTA_OUTPUT_ID: String

NIMMSTA_VERSION_ID

const val NIMMSTA_VERSION_ID: String

TAG

val TAG: String

Functions

batteryLevelChanged

fun batteryLevelChanged(device: NIMMSTADevice, newBatteryLevel: Int): Unit

checkNimmstaOutputField

Checks if the nimmsta-output-element contains text. If it contains text, it is parsed to a List of WebActions that are performed afterwards

fun checkNimmstaOutputField(serviceConnection: NIMMSTAServiceConnection?, node: AccessibilityNodeInfo? = NimmstaViewManager.tryToFindNIMMSTAOutputField()): Unit

deviceUpdate

Notifies webapps about device scan results, if device search is active

fun deviceUpdate(scanResult: SearchScanResult, action: DeviceListUpdateAction): Unit

didClickButton

Notifies webapps about button click events

fun didClickButton(device: NIMMSTADevice, sender: Button?, event: ButtonClickEvent): Unit

didConnectAndInit

Notifies socket about new connected devices or reconnected devices

fun didConnectAndInit(device: NIMMSTADevice): Unit

didDisconnect

fun didDisconnect(device: NIMMSTADevice, reason: Reason): Unit

didStartCharging

Notifies socket about a device that started charging

fun didStartCharging(device: NIMMSTADevice): Unit

didStopCharging

Notifies socket about a device that stopped charging

fun didStopCharging(device: NIMMSTADevice): Unit

didTouch

Notifies webapps about touch events

fun didTouch(device: NIMMSTADevice, x: Double, y: Double, screen: Int, event: TouchEvent): Unit

isActive

fun isActive(): Boolean

softwareUpdateProgress

Notifies webapps about software update progress.

fun softwareUpdateProgress(device: NIMMSTADevice, progress: SoftwareUpdateProgress): Unit