toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    'editable': editable,
    'id': id,
    'user_id': userId,
    'device_trackers': deviceTrackers,
    'friendly_name': friendlyName,

    // Light
    'brightness': brightness != null ? brightness : null,
    'supported_color_modes': supportedColorModes != null ? supportedColorModes : null,
    'rgb_color': rgbColor != null ? rgbColor : null,

    // Climate
    'hvac_modes': hvacModes != null ? hvacModes : null,
    'min_temp': minTemp,
    'max_temp': maxTemp,
    'current_temperature': currentTemperature,
    'temperature': temperature,
    'target_temp_low': targetTempLow,
    'target_temp_high': targetTempHigh,
    'preset_mode': presetMode,
    'hvac_action': hvacAction,
    'fan_mode': fanMode,

    // Camera
    'video_url': videoUrl,
    'entity_picture': entityPicture,
  };
}