MeterReading

data class MeterReading(val nanoTime: Long = System.nanoTime(), val systemTimestamp: Long = System.currentTimeMillis(), val meter: String, val channel: Int, val meterTime: Long? = null, val flags: List<String>? = null, val voltage: Int? = null, val current: Int? = null, val power: Int? = if (voltage != null && current != null) voltage * current / 1000 else null, val energy: Int? = null, val online: Boolean = true, val error: Boolean = false)

A reading received from the meter an event for reporting a successful measurement event

Constructors

Link copied to clipboard
constructor(nanoTime: Long = System.nanoTime(), systemTimestamp: Long = System.currentTimeMillis(), meter: String, channel: Int, meterTime: Long? = null, flags: List<String>? = null, voltage: Int? = null, current: Int? = null, power: Int? = if (voltage != null && current != null) voltage * current / 1000 else null, energy: Int? = null, online: Boolean = true, error: Boolean = false)

Properties

Link copied to clipboard

Associated meter channel (distinct events for each channel)

Link copied to clipboard
val current: Int? = null

Reported current value (if any)

Link copied to clipboard
val energy: Int? = null

Cumulative energy value (if any)

Link copied to clipboard
val error: Boolean = false

Error occurred during the reading event

Link copied to clipboard
val flags: List<String>? = null

Meter dependent flags.

Link copied to clipboard

Associated meter ID (there must be an associated PowerMeter)

Link copied to clipboard
val meterTime: Long? = null

Meter's internal timestamp.

Link copied to clipboard

Current value of the most precise available system timer, in nanoseconds.

Link copied to clipboard
val online: Boolean = true

Meter/channel online status

Link copied to clipboard
val power: Int?

Reported power value (higher precision than voltage * current, if any)

Link copied to clipboard

Current time in milliseconds.

Link copied to clipboard
val voltage: Int? = null

Reported voltage value (if any)

Functions

Link copied to clipboard
fun matches(meter: String, channel: Int): Boolean
Link copied to clipboard
open override fun toString(): String