code: private void updateComponentAvailability(ChargingStationId chargingStationId, ComponentId componentId, ChargingStationComponent component, Availability availability) {
          if (!component.equals(ChargingStationComponent.EVSE) || !(componentId instanceof EvseId)) {
              return;
          }
  
          ChargingStation chargingStation = repository.findOne(chargingStationId.getId());
  
          if (chargingStation != null) {
              for (Evse evse : chargingStation.getEvses()) {
                  if (evse.getEvseId().equals(componentId.getId())) {
                      evse.setAvailability(availability);
                      break;
                  }
              }
              repository.createOrUpdate(chargingStation);
          }
      }
docs: Updates a charging station's component availability.
  
  @param chargingStationId the charging station's id.
  @param componentId       the component's id.
  @param component         the component type.
  @param availability      the the charging station's new availability.