NIMMSTAManager

Holds the connected devices of the NIMMSTA App and some settings. Now uses dependency injection instead of singleton pattern.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Indicates whether the system allows managing multiple connected devices simultaneously. This property can be null if the setting value is not initialized or retrieved.

Link copied to clipboard

Returns currently connected devices

Link copied to clipboard

Provides a list of currently managed NIMMSTA devices. Each device in the list represents an instance of NIMMSTADevice, which is managed maintained by this NIMMSTAManager instance.

Link copied to clipboard

Determines whether a button input should be interpreted as a motion trigger.

Link copied to clipboard

Indicates whether the NIMMSTAService currently has an active instance.

Link copied to clipboard

Stores and manages the current settings of the NIMMSTAManager.

Functions

Link copied to clipboard
fun addOrUpdateDevice(json: JsonObject): NIMMSTADevice

Adds or updates NIMMSTADevice in devices

Link copied to clipboard
fun attachLightTag(macAddress: String, location: String): Task<Unit>

Associates a light tag with a specific location on a device, identified by its MAC address.

Link copied to clipboard

Cancels all ongoing connect attempts

Link copied to clipboard
fun cancelConnect(addressOrCode: String): Task<Unit>

Cancels a specific ongoing connect attempt with the given connectionCode or address

Link copied to clipboard

Cancels the search for scanners

Link copied to clipboard

Gets info if compatibility mode can be changed.

Link copied to clipboard

Gets and sets compatibility mode. Please check canChangeCompatibilityMode if can be changed.

Link copied to clipboard
fun connectToAddress(address: String, scanTimeout: Int? = null): Task<NIMMSTADevice>

Tries to connect to a device with the given address Can be canceled with cancelConnect

Link copied to clipboard
fun connectToConnectionCode(connectionCode: String, scanTimeout: Int? = null): Task<NIMMSTADevice>

Tries to connect to a device with the given connection code Can be canceled with cancelConnect

Link copied to clipboard
fun detachLightTag(macAddress: String): Task<Unit>

Detaches a light tag associated with a specific MAC address.

Link copied to clipboard

Displays the connect activity to scan with a scanner

Link copied to clipboard

Gets a new connection code from the NIMMSTA App

Link copied to clipboard

Tries to return the device with the given address null if not found

Link copied to clipboard

Initial request after creation to get devices and settings

Link copied to clipboard
fun removeDevice(device: NIMMSTADevice, removeFromGlobalDevices: Boolean = false)

Removes a specific device from the list of managed devices.

fun removeDevice(address: String, removeFromGlobalDevices: Boolean = false)

Removes a device with the specified address from the list of managed devices.

Link copied to clipboard

Starts the search for light tags

Link copied to clipboard

Starts the search for scanners.

Link copied to clipboard
fun setAppInBackgroundScreen(xmlString: String, parameters: Map<String, String> = mapOf()): Task<Unit>

Sets a custom layout to be displayed on the NIMMSTA device when the app is in the background.

Link copied to clipboard

Sets the desired light tags, associating each tag with the default illumination configuration.

fun setDesiredLightTags(lightTags: List<String>, config: LightTagIlluminationConfig = LightTagIlluminationConfig.Default): Task<Unit>

Sets the desired light tags with the specified illumination configuration.

fun setDesiredLightTags(lightTags: List<String>, color: LTColor, intensity: Int = LightTagIlluminationConfig.Default.intensity, pattern: LTBlinkingPattern = LightTagIlluminationConfig.Default.pattern): Task<Unit>

Sets the desired light tags with a specific illumination configuration.

Link copied to clipboard

Sets the desired light tags associated with the specified MAC addresses, applying the default illumination configuration for each light tag.

fun setDesiredLightTagsWithMacAddress(macAddresses: List<String>, config: LightTagIlluminationConfig = LightTagIlluminationConfig.Default): Task<Unit>

Sets the desired light tags associated with the given MAC addresses, applying the specified illumination configuration to each tag.

fun setDesiredLightTagsWithMacAddress(macAddresses: List<String>, color: LTColor, intensity: Int = LightTagIlluminationConfig.Default.intensity, pattern: LTBlinkingPattern = LightTagIlluminationConfig.Default.pattern): Task<Unit>

Sets the desired light tags for the specified devices, identified by their MAC addresses, applying the given illumination configuration settings which include color, intensity, and blinking pattern.

Link copied to clipboard

Cancels the search for light tags