ESPhome - esp8266 - custom component C++ - Import Input ESP32 state on dashboard

What is the code to export state from .h include file to dashboard ?
I made a blinking LED with h file, which works but don’t know how to import Pin state. Here my code:
ESP8266 H code:

#include “esphome.h”

class Blink : public Component {
 public:
  void setup() override {
    // This will be called once to set up the component
    // think of it as the setup() call in Arduino
    int What_I_Want_in_dashboard= 0; 
    int inpin=21;
    pinMode(2, OUTPUT);
    pinMode(inpin, INPUT);

 
  }
  void loop() override {
 
  
        digitalWrite(2, HIGH);
        delay(500);
        digitalWrite(2, LOW);
        delay(500);
        digitalWrite(2, LOW);
        What_I_Want_in_dashboard=digitalRead(inpin);
  }
};

ESPHOME YALM code:

substitutions:
  name: esphome-web-73afe6
  friendly_name: Heat_Pump_GTW-08

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  min_version: 2024.6.0
  name_add_mac_suffix: false
  project:
    name: esphome.web
    version: dev
  includes:
   - blink.h

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:
- platform: esphome

# Allow provisioning Wi-Fi via serial
improv_serial:

wifi:
  # Set up a wifi access point
  ap: {}

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:

dashboard_import:
  package_import_url: github://esphome/example-configs/esphome-web/esp8266.yaml@main
  import_full_config: true

# To have a "next url" for improv serial
web_server:
  port: 80


custom_component:
- lambda: |-
    auto blink = new Blink();
    return {blink};

  components:
  - id: my_custom_blink

What are you trying to achieve? Just knowing if your LED is flashing or not or knowing every pulse?

You could have flashed a light with the ESPhome light component without resorting to a custom component.

Let us know what you are trying to do.

Hello, thank you for your response.
In fact, I want to read all ESP32 pin state, and see them on my dash board. I don’t know the code in my .h file and also in my Yalm.
Just report the state: ON (or high) OFF (or low) I will manage by my own the project adaptation

To be precise, I want to see in my dashboard the variable “What_I_Want_in_dashboard”