# `Sml.ListEntry`
[🔗](https://github.com/emischorr/sml_ex/blob/v0.1.0/lib/sml/list_entry.ex#L1)

One entry of the value list in a `Sml.Messages.GetListResponse`
(`SML_ListEntry`), e.g. the meter reading for `1-0:1.8.0*255`.

`value` is the raw value as sent by the meter. Use `scaled_value/1` to get
the value with the scaler applied, and `Sml.Units` to interpret `unit`.

# `t`

```elixir
@type t() :: %Sml.ListEntry{
  obis: Sml.Obis.t() | binary(),
  scaler: integer() | nil,
  status: non_neg_integer() | nil,
  unit: Sml.Units.code() | nil,
  val_time: Sml.Time.t(),
  value: integer() | binary() | boolean() | list() | nil,
  value_signature: binary() | nil
}
```

# `scaled_value`

```elixir
@spec scaled_value(t()) :: number() | binary() | boolean() | list() | nil
```

Returns `value * 10^scaler`.

The result is an integer if the scaler is missing or not negative, and a
float otherwise. Non-numeric values are returned unchanged.

    iex> Sml.ListEntry.scaled_value(%Sml.ListEntry{value: 123_456, scaler: -1})
    12345.6

    iex> Sml.ListEntry.scaled_value(%Sml.ListEntry{value: 42, scaler: 2})
    4200

    iex> Sml.ListEntry.scaled_value(%Sml.ListEntry{value: "EMH", scaler: nil})
    "EMH"

# `unit_name`

```elixir
@spec unit_name(t()) :: atom() | nil
```

Returns the unit name (e.g. `:wh`) of the entry, see `Sml.Units.name/1`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
