class WifiStatus {
  const WifiStatus({
    required this.connected,
    this.ssid,
    this.ip,
  });

  final bool connected;
  final String? ssid;
  final String? ip;

  factory WifiStatus.disconnected() {
    return const WifiStatus(connected: false);
  }

  factory WifiStatus.fromJson(Map<String, dynamic> json) {
    return WifiStatus(
      connected: json['connected'] as bool? ?? false,
      ssid: json['ssid'] as String?,
      ip: json['ip'] as String?,
    );
  }
}
