DSMR.Measurement (DSMR v1.1.0)

Copy Markdown View Source

A numeric value with a DSMR unit.

Measurements are used for electricity, gas, voltage, current, and duration values. Values are parsed as native numbers by default. When DSMR.parse/2 is called with floats: :decimals, decimal values are returned as %Decimal{} structs.

Summary

Types

t()

raw holds the exact numeric text from the telegram (e.g. "000123.456") so that serialization can reproduce the original padding and precision. It is nil for measurements constructed by hand.

Types

t()

@type t() :: %DSMR.Measurement{
  raw: String.t() | nil,
  unit: String.t(),
  value: integer() | float() | Decimal.t()
}

raw holds the exact numeric text from the telegram (e.g. "000123.456") so that serialization can reproduce the original padding and precision. It is nil for measurements constructed by hand.