How to get sensor values with the Input System?

I am trying to get the distance value from the proximity sensor by using unity’s Input System but nothing that I tried seems to work. I tried looking into the documentation, there it says something about “AxisControl” but I have no clue how to code it to work.
https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/api/UnityEngine.InputSystem.ProximitySensor.html

This my code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
using TMPro;
using System;
public class Sensors : MonoBehaviour
{
    public TMP_Text textprox;
    public ProximitySensor proximity;

    void Start()
    {
        proximity = ProximitySensor.current;
    }

    void Update()
    {
        if(proximity != null)
        {
            InputSystem.EnableDevice(proximity);
            var _ProximitySensor = ProximitySensor.current;
            var _dist = _ProximitySensor.distance;
            textprox.text = "Proxy: " + _dist;
        }
        else
        {
            textprox.text = "null";
        }
    }
}

@pandagamingroyt > Try this


public float ProximityDistanceSensor(bool m_isActiveProxSens, float m_frequency = 16f)
            {
                proximitySensor.samplingFrequency = m_frequency; // Set sampling frequency of proximitySensor to sample 16 times per second.
                
                if (m_isActiveProxSens)
                {
                    InputSystem.EnableDevice(proximitySensor);
                    Debug.Log("Proximity sensor is: " + proximitySensor.enabled);
                }
                else
                {
                    InputSystem.DisableDevice(proximitySensor);
                    Debug.Log("Proximity sensor is: " + proximitySensor.enabled);
                }
    
                return actionControlls.UI.DistanceActionSensor.ReadValue<float>();
            }