LightDimmingDelta.fromJson constructor

LightDimmingDelta.fromJson(
  1. Map<String, dynamic> dataMap
)

Creates a LightDimmingDelta object from the JSON response to a GET request.

Implementation

factory LightDimmingDelta.fromJson(Map<String, dynamic> dataMap) {
  return LightDimmingDelta(
    action:
        LightDimmingDeltaAction.fromString(dataMap[ApiFields.action] ?? ""),
    delta: ((dataMap[ApiFields.brightnessDelta]) as num?)?.toDouble(),
  );
}