using EVCB_OCPP.Packet.Features.FirmwareManagement;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EVCB_OCPP.Packet.Features
{
   
    public class FirmwareManagementProfile : Profile
    {
        public FirmwareManagementProfile()
        {
            Name = "FirmwareManagement";
            //加入支援的Features
            features.Add(new GetDiagnosticsFeature());
            features.Add(new DiagnosticsStatusNotificationFeature());
            features.Add(new FirmwareStatusNotificationFeature());
            features.Add(new UpdateFirmwareFeature());
           

            actions.Add(Actions.GetDiagnostics.ToString());
            actions.Add(Actions.DiagnosticsStatusNotification.ToString());
            actions.Add(Actions.FirmwareStatusNotification.ToString());
            actions.Add(Actions.UpdateFirmware.ToString());
           

        }

        public string GetActionFromConfirmation(Type seekType)
        {
            return features.Where(x => x.GetConfirmationType() == seekType).FirstOrDefault().GetAction();
        }

        public string GetActionFromRequest(Type seekType)
        {
            return GetFeaturebyType(seekType).GetAction();
        }




    }
}
