All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.huawei.hilink.c2c.integration.helper.api.DeviceSnapshot.kt Maven / Gradle / Ivy

package com.huawei.hilink.c2c.integration.helper.api

/**
 * A description of the current state of a device.
 *
 * @param deviceId id of the device. Can by up to 128 characters long.
 * @param isOnline a boolean indicating whether or not the device is online
 * @param services a list of [DeviceServiceSnapshot] objects, describing states
 * of the individual deviceServices of a given device.
 */
public class DeviceSnapshot(
    public val deviceId: String,
    public val isOnline: Boolean,
    public val services: List
)

/**
 * A snapshot of state of a deviceService.
 *
 * @param timestamp a timestamp in milliseconds since 1970.01.01 00:00:00:0000 UTC
 * @param serviceIdInPartnerSystem id of the deviceService in the partner's system. Up to 64 characters long.
 * @param serviceDataJson a raw Json string describing the state of the deviceService (feature).
 * The json should contain properties reflecting the parameters of a given device service and should
 * use data types understandable for HiLink cloud, that is converted from partner system's types.
 * For example:
 *
 * ```
 *    class SwitchServiceData(
 *      val on: Int
 *    )
 * ```
 *
 * Another example, for an RGBW color, which could be used to describe an RGBW Bulb's light color:
 * ```
 *    class ColorServiceData(
 *      val red: Int,
 *      val green: Int,
 *      val blue: Int,
 *      val white: Int
 *    )
 * ```
 */
public class DeviceServiceSnapshot(
    public val timestamp: Long,
    public val serviceIdInPartnerSystem: String,
    public val serviceDataJson: String
)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy